|
|
@ -4,6 +4,7 @@ const livereload = require('gulp-livereload');
|
|
|
|
const path = require('path');
|
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const errorHandler = require('./helpers/errorHandler');
|
|
|
|
const errorHandler = require('./helpers/errorHandler');
|
|
|
|
|
|
|
|
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
|
@ -47,6 +48,8 @@ HtmlWebpackPlugin.prototype.injectAssetsIntoHtml = function(html, assets, assetT
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const plugins = [
|
|
|
|
const plugins = [
|
|
|
|
|
|
|
|
new OptimizeCssAssetsPlugin({}),
|
|
|
|
|
|
|
|
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
__DEV__: !isProduction,
|
|
|
|
__DEV__: !isProduction,
|
|
|
|
'process.env.NODE_ENV': isProduction ? JSON.stringify('production') : JSON.stringify('development')
|
|
|
|
'process.env.NODE_ENV': isProduction ? JSON.stringify('production') : JSON.stringify('development')
|
|
|
@ -254,7 +257,7 @@ gulp.task('webpack', () => {
|
|
|
|
gulp.task('webpackWatch', () => {
|
|
|
|
gulp.task('webpackWatch', () => {
|
|
|
|
config.watch = true;
|
|
|
|
config.watch = true;
|
|
|
|
|
|
|
|
|
|
|
|
return webpackStream(config)
|
|
|
|
return webpackStream(config, webpack)
|
|
|
|
.on('error', errorHandler)
|
|
|
|
.on('error', errorHandler)
|
|
|
|
.pipe(gulp.dest('_output/UI'))
|
|
|
|
.pipe(gulp.dest('_output/UI'))
|
|
|
|
.on('error', errorHandler)
|
|
|
|
.on('error', errorHandler)
|
|
|
|