chore(build): speedup by using only one browserify target

This commit is contained in:
Nico Rehwaldt 2014-06-02 15:37:50 +02:00
parent bd70eced41
commit 832cd864e0
1 changed files with 14 additions and 37 deletions

View File

@ -87,52 +87,29 @@ module.exports = function(grunt) {
detectGlobals: false, detectGlobals: false,
insertGlobalVars: [], insertGlobalVars: [],
debug: true debug: true
} },
alias: [
'node_modules/jquery:jquery',
'node_modules/lodash:lodash',
'node_modules/bpmn-moddle:bpmn-moddle',
'<%= config.sources %>/main.js:bpmn-js',
'<%= config.sources %>/Viewer.js:bpmn-js/Viewer',
'<%= config.sources %>/Modeler.js:bpmn-js/Modeler'
]
}, },
watch: { watch: {
options: {
alias: [
'node_modules/jquery:jquery',
'node_modules/lodash:lodash',
'node_modules/bpmn-moddle:bpmn-moddle',
'<%= config.sources %>/main.js:bpmn-js',
'<%= config.sources %>/Viewer.js:bpmn-js/Viewer',
'<%= config.sources %>/Modeler.js:bpmn-js/Modeler'
],
watch: true
},
files: { files: {
'<%= config.dist %>/bpmn.js': [ '<%= config.sources %>/**/*.js' ], '<%= config.dist %>/bpmn.js': [ '<%= config.sources %>/**/*.js' ],
'<%= config.dist %>/bpmn-viewer.js': [ '<%= config.sources %>/lib/Viewer.js' ] '<%= config.dist %>/bpmn-viewer.js': [ '<%= config.sources %>/lib/Viewer.js' ]
}
},
modeler: {
files: {
'<%= config.dist %>/bpmn.js': [ '<%= config.sources %>/**/*.js' ]
}, },
options: { options: {
alias: [ watch: true
'node_modules/jquery:jquery',
'node_modules/lodash:lodash',
'node_modules/bpmn-moddle:bpmn-moddle',
'<%= config.sources %>/main.js:bpmn-js',
'<%= config.sources %>/Viewer.js:bpmn-js/Viewer',
'<%= config.sources %>/Modeler.js:bpmn-js/Modeler'
]
} }
}, },
viewer: { lib: {
files: { files: {
'<%= config.dist %>/bpmn.js': [ '<%= config.sources %>/**/*.js' ],
'<%= config.dist %>/bpmn-viewer.js': [ '<%= config.sources %>/lib/Viewer.js' ] '<%= config.dist %>/bpmn-viewer.js': [ '<%= config.sources %>/lib/Viewer.js' ]
},
options: {
alias: [
'node_modules/jquery:jquery',
'node_modules/lodash:lodash',
'node_modules/bpmn-moddle:bpmn-moddle',
'<%= config.sources %>/main.js:bpmn-js',
'<%= config.sources %>/Viewer.js:bpmn-js/Viewer'
]
} }
} }
}, },
@ -248,7 +225,7 @@ module.exports = function(grunt) {
tasks.push('uglify:modeler', 'uglify:viewer'); tasks.push('uglify:modeler', 'uglify:viewer');
} }
return grunt.task.run([ 'browserify:modeler', 'browserify:viewer' ].concat(tasks)); return grunt.task.run(['browserify:lib'].concat(tasks));
} }
if (target === 'samples') { if (target === 'samples') {
@ -256,7 +233,7 @@ module.exports = function(grunt) {
} }
if (!target || target === 'all') { if (!target || target === 'all') {
return grunt.task.run([ 'build:lib:' + mode, 'build:samples:' + mode ]); return grunt.task.run(['build:lib:' + mode, 'build:samples:' + mode]);
} }
}); });