chore(build): speedup by using only one browserify target
This commit is contained in:
parent
bd70eced41
commit
832cd864e0
51
Gruntfile.js
51
Gruntfile.js
|
@ -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]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue