为了账号安全,请及时绑定邮箱和手机立即绑定

ES6彩票实战项目中webpack-stream - No files given问题

/ 猿问

ES6彩票实战项目中webpack-stream - No files given问题

慕勒6482496 2018-12-15 12:15:26

import gulp from 'gulp';

import gulpif from 'gulp-if';

import concat from 'gulp-concat';

import webpack from 'webpack';

import gulpWebpack from 'webpack-stream';

import named from 'vinyl-named';

import livereload from 'gulp-livereload';

import plumber from 'gulp-plumber';

import rename from 'gulp-rename';

import uglify from 'gulp-uglify';

import {log,colors} from 'gulp-util';

import args from './util/args';


gulp.task('scripts',()=>{

return gulp.src(['app/js/index.js'])

.pipe(plumber({

errorHandle:function(){


}

}))

.pipe(named())

.pipe(gulpWebpack({

module:{

loaders:[{

test: /\.js$/,

loader: 'babel-loader'

}]

}

}),null,(err,stats)=>{

log(`Finished '${colors.cyan('scripts')}'`,stats.toString({

chunks:false

}))

})

.pipe(gulp.dest('server/public/js'))

.pipe(rename({

basename:'cp',

extname:'.min.js'

}))

.pipe(uglify({compress:{properties:false},output:{'quote_keys':true}}))

.pipe(gulp.dest('server/public/js'))

.pipe(gulpif(args.watch,livereload()))

})



查看完整描述

目前暂无任何回答

添加回答

回复

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信