...
|
...
|
@@ -100,7 +100,6 @@ const postcssPlugin = (et) => { |
|
|
require('postcss-sprites').default(sprites),
|
|
|
require('postcss-assets')(assets),
|
|
|
require('postcss-calc'),
|
|
|
require('postcss-opacity'),
|
|
|
require('postcss-pxtorem')({
|
|
|
rootValue: 40,
|
|
|
unitPrecision: 5, // 保留5位小数字
|
...
|
...
|
@@ -201,15 +200,20 @@ gulp.task('webpack-dev-server', () => { |
|
|
});
|
|
|
|
|
|
// webpack compile in pro
|
|
|
gulp.task('webpack', () => {
|
|
|
gulp.task('webpack', (done) => {
|
|
|
var proConfig = Object.assign({}, webpackConfig);
|
|
|
|
|
|
proConfig.output.path = dist.js;
|
|
|
proConfig.plugins = [new webpack.optimize.UglifyJsPlugin()];
|
|
|
proConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({
|
|
|
compress: {
|
|
|
warnings: false
|
|
|
}
|
|
|
}));
|
|
|
webpack(proConfig, (err, stats) => {
|
|
|
if (err) {
|
|
|
throw new gutil.PluginError('webpack', err);
|
|
|
}
|
|
|
gutil.log('[webpack compile]:', stats.endTime - stats.startTime, 'ms');
|
|
|
done();
|
|
|
});
|
|
|
}); |
...
|
...
|
|