我的“脚本” gulp-task需要几秒钟才能完成,我对为什么会非常好奇。但是我无法解决问题。
[08:22:49] Starting 'styles'...
[08:22:49] Starting 'scripts'...
[08:22:50] Finished 'styles' after 1.04 s
[08:23:07] Finished 'scripts' after 18 s
[08:23:07] Starting 'default'...
[08:23:07] Finished 'default' after 114 ms
我的任务:
gulp.task('scripts', () =>
browserify({
entries: 'index.jsx',
extensions: ['.jsx'],
debug: true,
})
.transform(babelify)
.bundle()
.on('error', (err) => {
gutil.log('Browserify Error', gutil.colors.red(err.message));
})
.pipe(source('index.min.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(uglify())
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('./dist')));