I have a gulp rjs task that concatenates and uglifies all my custom .JS files (any non vendor libraries).
What i am trying to do, is exclude some files/directories from this task (controllers and directives).
Heres my tree:
- application
- resources
- js
main.js
- vendor
- jquery
- modernzr
- angular
- controllers
- controller1
- controller2
- controller3
- directives
- directives1
- directives2
- directives3
- widgets
- widget1
- widget2
- widget3
- widget4
- modules
- modules1
- modules2
- modules3
- modules4
Here my gulp.js
dir = {
app: 'application',
dest: 'dest',
};
config = {
src: {
js: dir.app + '/resources/js'
},
dest: {
js: dir.dest + '/resources/js'
}
};
gulp.task('rjs', function() {
rjs({
baseUrl: config.src.js,
out: 'main.js',
name: 'main',
mainConfigFile: config.src.js + '/main.js',
exclude: [ 'jquery', 'angular']
})
.pipe(prod ? uglify({ mangle: false, outSourceMap: true, compress: { drop_console: true } }) : gutil.noop())
.pipe(gulp.dest(config.dest.js))
.pipe(filesize())
.pipe(dev ? connect.reload() : gutil.noop());
});
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…