2018-01-05 15:09:39 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var bundle = require('./bundle');
|
|
|
|
|
2018-01-08 08:19:19 +00:00
|
|
|
var path = require('path');
|
|
|
|
|
|
|
|
var mkdirp = require('mkdirp').sync,
|
|
|
|
cp = require('cpx').copySync,
|
|
|
|
del = require('del').sync;
|
|
|
|
|
2018-01-08 08:30:02 +00:00
|
|
|
var dest = process.env.DISTRO_DIST || 'dist';
|
2018-01-08 08:19:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
function resolve(module, sub) {
|
|
|
|
var pkg = require.resolve(module + '/package.json');
|
|
|
|
|
|
|
|
return path.dirname(pkg) + sub;
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('clean ' + dest);
|
|
|
|
del(dest);
|
|
|
|
|
|
|
|
console.log('mkdir -p ' + dest);
|
|
|
|
mkdirp(dest);
|
|
|
|
|
2018-01-28 19:55:52 +00:00
|
|
|
console.log('copy bpmn-font to ' + dest + '/bpmn-font');
|
2018-01-08 08:24:49 +00:00
|
|
|
cp(resolve('bpmn-font', '/dist/{font,css}/**'), dest + '/assets/bpmn-font');
|
2018-01-08 08:19:19 +00:00
|
|
|
|
2018-01-28 19:55:52 +00:00
|
|
|
console.log('copy diagram-js.css to ' + dest);
|
2018-01-08 08:19:19 +00:00
|
|
|
cp(resolve('diagram-js', '/assets/**'), dest + '/assets');
|
|
|
|
|
|
|
|
bundle(dest, {
|
2018-01-05 15:09:39 +00:00
|
|
|
'bpmn-viewer': 'lib/Viewer.js',
|
|
|
|
'bpmn-navigated-viewer': 'lib/NavigatedViewer.js',
|
|
|
|
'bpmn-modeler': 'lib/Modeler.js'
|
|
|
|
}, function(err) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
console.error('bundling failed', err);
|
|
|
|
}
|
|
|
|
});
|