Skip to content

Instantly share code, notes, and snippets.

@ilearnjavascript
Last active April 6, 2019 11:45
Show Gist options
  • Save ilearnjavascript/9cbd4263680a483913fe12e7f5f8182d to your computer and use it in GitHub Desktop.
Save ilearnjavascript/9cbd4263680a483913fe12e7f5f8182d to your computer and use it in GitHub Desktop.
gulp - gulpfile - 12.js
// add to plugins
const inject = require('gulp-inject');
// build dev
gulp.task('build:dev', function() {
const target = gulp.src('src/index.html');
const sources = gulp.src(['temp/main.js', 'temp/style.css'], { read: false });
return target.pipe(inject(sources))
.pipe(gulp.dest('build/dev'))
.pipe(connect.reload())
});
// build development runner
gulp.task('dev', gulp.series(
'compile:sass',
'autoprefix:css',
'babel',
'dev:transfer',
'build:dev',
'clean'
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment