Last active
May 15, 2020 10:03
-
-
Save farooqarahim/6b77d1dc40b01ed8f33873944d80c307 to your computer and use it in GitHub Desktop.
Revisions
-
farooqarahim revised this gist
May 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ function Task() { }) ) .bundle() .on('error', function(error) { console.error(error); this.emit('end'); }) .pipe(source('bundle.js')) .pipe(buffer()) .pipe(sourcemaps.init({ loadMaps: true })) -
farooqarahim created this gist
May 14, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ const { watch, dest, series, parallel } = require('gulp'); const sourcemaps = require('gulp-sourcemaps'); const terser = require('gulp-terser-js'); const browserify = require('browserify'); const watchify = require('watchify'); const babelify = require('babelify'); const source = require('vinyl-source-stream'); const buffer = require('vinyl-buffer'); function Task() { return watchify( browserify({ entries: [`./lib/index.js`], transform: [ babelify.configure({ presets: ['@babel/preset-env'], plugins: ['@babel/plugin-transform-runtime', '@babel/plugin-transform-async-to-generator'] }), ], standalone: 'std-test', debug: true, }) ) .bundle() .on('error', function(error) { console.error(error); this.emit('end'); }) .pipe(source('bundle.js')) .pipe(buffer()) .pipe(sourcemaps.init({ loadMaps: true })) .pipe(terser()) .pipe(sourcemaps.write('.')) .pipe(dest('dist')); } function watchTask() { watch(['lib/**/*.js'], parallel(Task)); } exports.default = series(clean, parallel(Task), watchTask);