|
@@ -3,8 +3,9 @@ const path = require('path')
|
|
|
const rm = require('rimraf')
|
|
|
const defaultSettings = require('./src/settings.js')
|
|
|
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
|
|
-
|
|
|
+const TerserPlugin = require('terser-webpack-plugin')
|
|
|
const webpack = require('webpack')
|
|
|
+const WebpackBar = require('webpackbar')
|
|
|
|
|
|
function resolve(dir) {
|
|
|
return path.join(__dirname, dir)
|
|
@@ -105,7 +106,33 @@ module.exports = {
|
|
|
'staticPub': resolve('public')
|
|
|
}
|
|
|
},
|
|
|
- devtool: '#eval-source-map',
|
|
|
+
|
|
|
+ cache: {
|
|
|
+ type: 'filesystem',
|
|
|
+ allowCollectingMemory: true
|
|
|
+ },
|
|
|
+ devtool: 'none',
|
|
|
+ optimization: {
|
|
|
+ minimize: true,
|
|
|
+ minimizer: [
|
|
|
+ new TerserPlugin({
|
|
|
+ cache: true,
|
|
|
+ sourceMap: false,
|
|
|
+ parallel: true,
|
|
|
+ terserOptions: {
|
|
|
+ compress: {
|
|
|
+ drop_console: true,
|
|
|
+ drop_debugger: true,
|
|
|
+ pure_funcs: ["console.log", "console.error"],
|
|
|
+ },
|
|
|
+ format: {
|
|
|
+ comments: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ extractComments: false,
|
|
|
+ })
|
|
|
+ ]
|
|
|
+ },
|
|
|
plugins: [
|
|
|
new CompressionWebpackPlugin(
|
|
|
{
|
|
@@ -113,50 +140,23 @@ module.exports = {
|
|
|
algorithm: 'gzip',
|
|
|
test: /\.js$|\.html$|\.json$|\.css/,
|
|
|
threshold: 0,
|
|
|
- minRatio: 0.4,
|
|
|
- deleteOriginalAssets: false
|
|
|
+ minRatio: 0.8,
|
|
|
+ deleteOriginalAssets: false
|
|
|
}
|
|
|
),
|
|
|
- new webpack.ProvidePlugin(
|
|
|
- {
|
|
|
- $: 'jquery',
|
|
|
- jQuery: 'jquery',
|
|
|
- 'windows.jQuery': 'jquery'
|
|
|
- }
|
|
|
- )
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ new webpack.ProvidePlugin({
|
|
|
+ $: 'jquery',
|
|
|
+ jQuery: 'jquery',
|
|
|
+ jquery: 'jquery',
|
|
|
+ 'windows.jQuery': 'jquery'
|
|
|
+ }),
|
|
|
+ new WebpackBar({
|
|
|
+ color: '#85d',
|
|
|
+ basic: false,
|
|
|
+ profile: false
|
|
|
+ })
|
|
|
]
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
},
|
|
|
|