代码拉取完成,页面将自动刷新
var path = require('path');
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
/**
* Resolve external project resource as file path
*/
function resolvePath(project, file) {
return path.join(path.dirname(require.resolve(project)), file);
}
grunt.initConfig({
browserify: {
options: {
browserifyOptions: {
debug: true
},
transform: [
[ 'stringify', {
extensions: [ '.bpmn' ]
} ]
],
plugin: [
'esmify'
]
},
watch: {
options: {
watch: true
},
files: {
'dist/app.js': [ 'app/**/*.js' ]
}
},
app: {
files: {
'dist/app.js': [ 'app/**/*.js' ]
}
}
},
copy: {
diagram_js: {
files: [
{
src: resolvePath('diagram-js', 'assets/diagram-js.css'),
dest: 'dist/css/diagram-js.css'
}
]
},
bpmn_js: {
files: [
{
expand: true,
cwd: resolvePath('bpmn-js', 'dist/assets'),
src: ['**/*.*', '!**/*.js'],
dest: 'dist/vendor'
}
]
},
app: {
files: [
{
expand: true,
cwd: 'app/',
src: ['**/*.*', '!**/*.js'],
dest: 'dist'
}
]
}
},
less: {
options: {
dumpLineNumbers: 'comments',
paths: [
'node_modules'
]
},
styles: {
files: {
'dist/css/app.css': 'styles/app.less'
}
}
},
watch: {
options: {
livereload: true
},
samples: {
files: [ 'app/**/*.*' ],
tasks: [ 'copy:app' ]
},
less: {
files: [
'styles/**/*.less',
'node_modules/bpmn-js-properties-panel/styles/**/*.less'
],
tasks: [
'less'
]
},
},
connect: {
livereload: {
options: {
port: 9013,
livereload: true,
hostname: 'localhost',
open: true,
base: [
'dist'
]
}
}
}
});
// tasks
grunt.registerTask('build', [ 'copy', 'less', 'browserify:app' ]);
grunt.registerTask('auto-build', [
'copy',
'less',
'browserify:watch',
'connect:livereload',
'watch'
]);
grunt.registerTask('default', [ 'build' ]);
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。