Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- |-- dist
- |-- js
- |-- css
- |-- img
- |-- index.html
- output: {
- filename: '[name]-[hash].bundle.js',
- path: path.resolve(__dirname, 'dist/js'),
- },
- const gulp = require('gulp');
- const clean = require('gulp-clean');
- gulp.task('clean-logs', () =>
- gulp.src('./logs/*.log', {
- read: false,
- }).pipe(clean()));
- // Take all static files in the /dist directory
- // and organize them into folders based on type
- gulp.task('organize-dist-static-files', () => {
- gulp.src('./dist/*.{png,gif,jpg,jpeg,svg}')
- .pipe(gulp.dest('./dist/static/img'));
- gulp.src('./dist/*.js')
- .pipe(gulp.dest('./dist/static/js'));
- gulp.src('./dist/*.css')
- .pipe(gulp.dest('./dist/static/css'));
- gulp.src('./dist/*.{woff,woff2,eot,ttf,otf}')
- .pipe(gulp.dest('./dist/static/fonts'));
- });
- gulp.task('clean-original-dist-files', () => {
- // remove files from original locations
- gulp.src('./dist/*.{png,gif,jpg,jpeg,svg,js,css,woff,woff2,eot,ttf,otf}', {
- read: false,
- }).pipe(clean());
- });
Add Comment
Please, Sign In to add comment