Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save chris-peng-1244/4119b500d3d3817e33f4b1cd2063dedf to your computer and use it in GitHub Desktop.

Select an option

Save chris-peng-1244/4119b500d3d3817e33f4b1cd2063dedf to your computer and use it in GitHub Desktop.
const gulp = require('gulp');
const gulpBabel= require('gulp-babel');
const sourceMaps = require('gulp-sourcemaps');
gulp.task('build', () => {
gulp.src('src/**/*.js')
.pipe(sourceMaps.init())
.pipe(gulpBabel({
"presets": [
[
"env"
]
],
"sourceMaps": true,
}))
.pipe(sourceMaps.write('.', {includeContent: false, sourceRoot: './src'}))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', () => {
gulp.watch('src/**/*.js', ['dist']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment