Skip to content

Commit

Permalink
bundle main file and thread file into one file
Browse files Browse the repository at this point in the history
fixes #175
  • Loading branch information
kkaefer committed Nov 25, 2013
1 parent e090980 commit 1fe81bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
11 changes: 1 addition & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ module.exports = function(grunt) {
standalone: 'llmr'
}
},
worker: {
files: {
'dist/llmr-worker.js': ['js/worker.js']
},
entry: 'js/worker.js',
options: {
debug: true
}
},
editor: {
files: {
'editor/dist/editor.js': ['editor/js/editor.js']
Expand All @@ -34,7 +25,7 @@ module.exports = function(grunt) {
watch: {
llmr: {
files: ['js/*.js'],
tasks: ['browserify:llmr', 'browserify:worker']
tasks: ['browserify:llmr']
},
editor: {
files: ['editor/js/*.js'],
Expand Down
2 changes: 1 addition & 1 deletion js/dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var Actor = require('./actor.js');

var scripts = document.getElementsByTagName("script");
var workerFile = scripts[scripts.length - 1].getAttribute('src').replace(/.js$/, '-worker.js');
var workerFile = scripts[scripts.length - 1].getAttribute('src');



Expand Down
16 changes: 10 additions & 6 deletions js/llmr.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
'use strict';

exports.Map = require('./map.js');
exports.Style = require('./style.js');
exports.StyleLayer = require('./stylelayer.js');
exports.evented = require('./evented.js');
exports.chroma = require('./lib/chroma.js');
exports.util = require('./util.js');
if (typeof window === 'undefined') {
require('./worker.js');
} else {
exports.Map = require('./map.js');
exports.Style = require('./style.js');
exports.StyleLayer = require('./stylelayer.js');
exports.evented = require('./evented.js');
exports.chroma = require('./lib/chroma.js');
exports.util = require('./util.js');
}

0 comments on commit 1fe81bd

Please sign in to comment.