Created
August 1, 2018 05:52
-
-
Save chris-peng-1244/4119b500d3d3817e33f4b1cd2063dedf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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