Upgrade client dependencies
This commit is contained in:
parent
74921541db
commit
ae04a0ce12
10 changed files with 1259 additions and 1419 deletions
|
@ -3,15 +3,12 @@ const path = require('path')
|
|||
|
||||
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
const HashedModuleIdsPlugin = require('webpack/lib/HashedModuleIdsPlugin')
|
||||
const TerserPlugin = require('terser-webpack-plugin')
|
||||
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const PurifyCSSPlugin = require('purifycss-webpack')
|
||||
|
||||
module.exports = function () {
|
||||
const isProd = process.env.NODE_ENV === 'production'
|
||||
|
||||
const configuration = {
|
||||
entry: {
|
||||
'video-embed': './src/standalone/videos/embed.ts',
|
||||
|
@ -72,7 +69,12 @@ module.exports = function () {
|
|||
importLoaders: 1
|
||||
}
|
||||
},
|
||||
'resolve-url-loader',
|
||||
// {
|
||||
// loader: 'resolve-url-loader',
|
||||
// options: {
|
||||
// debug: true
|
||||
// }
|
||||
// },
|
||||
{
|
||||
loader: 'sass-loader',
|
||||
options: {
|
||||
|
@ -113,9 +115,9 @@ module.exports = function () {
|
|||
}),
|
||||
|
||||
new PurifyCSSPlugin({
|
||||
paths: [
|
||||
paths: [
|
||||
helpers.root('src/standalone/videos/embed.ts'),
|
||||
helpers.root('src/standalone/videos/test-embed.html')
|
||||
helpers.root('src/standalone/videos/test-embed.html')
|
||||
],
|
||||
purifyOptions: {
|
||||
minify: true,
|
||||
|
@ -158,6 +160,27 @@ module.exports = function () {
|
|||
})
|
||||
],
|
||||
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
ecma: 6,
|
||||
warnings: false,
|
||||
ie8: false,
|
||||
mangle: true,
|
||||
compress: {
|
||||
passes: 3,
|
||||
pure_getters: true
|
||||
},
|
||||
output: {
|
||||
ascii_only: true,
|
||||
comments: false
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
|
||||
performance: {
|
||||
maxEntrypointSize: 700000, // 600kB
|
||||
maxAssetSize: 700000
|
||||
|
@ -174,28 +197,5 @@ module.exports = function () {
|
|||
}
|
||||
}
|
||||
|
||||
if (isProd) {
|
||||
configuration.plugins.push(
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
ecma: 6,
|
||||
warnings: false,
|
||||
ie8: false,
|
||||
mangle: true,
|
||||
compress: {
|
||||
passes: 3,
|
||||
pure_getters: true
|
||||
},
|
||||
output: {
|
||||
ascii_only: true,
|
||||
comments: false
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
new HashedModuleIdsPlugin()
|
||||
)
|
||||
}
|
||||
|
||||
return configuration
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue