I've this chrome extension that I'm working on, is there anyway i can minify all css and js and move to the build folder without losing the structure?
gulp.task('clean', function() {
return gulp.src('build/*', {read: false})
.pipe(clean());
});
gulp.task('copy', function() {
gulp.src('assets/fonts/**')
.pipe(gulp.dest('build/fonts'));
gulp.src('assets/images/**')
.pipe(gulp.dest('build/images'));
gulp.src('_locales/**')
.pipe(gulp.dest('build/_locales'));
return gulp.src('src/manifest.json')
.pipe(gulp.dest('build'));
});
gulp.task('html', function() {
return gulp.src('popup/*.html')
.pipe(cleanhtml())
.pipe(gulp.dest('build'));
});
gulp.task('scripts', ['jshint'], function() {
gulp.src('/**/*.js')
.pipe(gulp.dest('/**/*.js'));
return gulp.src(['/**/*.js', '!/**/*.js'])
.pipe(stripdebug())
.pipe(uglify({outSourceMap: true}))
.pipe(gulp.dest('build/**/*'));
});
currently this works for the css and other assets, but I cant figure out how to do it withe js as I have everything split up neatly in folders and components
move to the build folder without losing the structure?