mirror of https://github.com/portainer/portainer
feat(webpack): reduce lodash size
parent
1b57b657bd
commit
558036ee53
|
@ -24,7 +24,7 @@
|
||||||
"dev": "yarn grunt run-dev",
|
"dev": "yarn grunt run-dev",
|
||||||
"clean-all": "yarn grunt clean:all",
|
"clean-all": "yarn grunt clean:all",
|
||||||
"dev:client": "webpack",
|
"dev:client": "webpack",
|
||||||
"build:client": "webpack --config ./webpack/webpack.production.js",
|
"build:client": "webpack -p --config ./webpack/webpack.production.js",
|
||||||
"build-offline": "cd ./api/cmd/portainer && CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s' && mv -b portainer ../../../dist/portainer-linux-amd64"
|
"build-offline": "cd ./api/cmd/portainer && CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s' && mv -b portainer ../../../dist/portainer-linux-amd64"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
@ -101,6 +101,7 @@
|
||||||
"html-loader": "^0.5.5",
|
"html-loader": "^0.5.5",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"load-grunt-tasks": "^3.5.2",
|
"load-grunt-tasks": "^3.5.2",
|
||||||
|
"lodash-webpack-plugin": "^0.11.5",
|
||||||
"mini-css-extract-plugin": "^0.4.4",
|
"mini-css-extract-plugin": "^0.4.4",
|
||||||
"ngtemplate-loader": "^2.0.1",
|
"ngtemplate-loader": "^2.0.1",
|
||||||
"style-loader": "^0.23.1",
|
"style-loader": "^0.23.1",
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { ProvidePlugin, ContextReplacementPlugin } = require('webpack');
|
const { ProvidePlugin, IgnorePlugin } = require('webpack');
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const WebpackBuildNotifierPlugin = require('webpack-build-notifier');
|
const WebpackBuildNotifierPlugin = require('webpack-build-notifier');
|
||||||
const CleanTerminalPlugin = require('clean-terminal-webpack-plugin');
|
const CleanTerminalPlugin = require('clean-terminal-webpack-plugin');
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||||
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||||
|
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
|
||||||
const npmPackage = require('../package.json');
|
const npmPackage = require('../package.json');
|
||||||
const projectRoot = path.resolve(__dirname, '..');
|
const projectRoot = path.resolve(__dirname, '..');
|
||||||
|
|
||||||
|
@ -92,7 +93,7 @@ module.exports = {
|
||||||
new ProvidePlugin({
|
new ProvidePlugin({
|
||||||
$: 'jquery',
|
$: 'jquery',
|
||||||
jQuery: 'jquery',
|
jQuery: 'jquery',
|
||||||
'window.jQuery': 'jquery',
|
'window.jQuery': 'jquery'
|
||||||
}),
|
}),
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
filename: '[name].css',
|
filename: '[name].css',
|
||||||
|
@ -100,8 +101,9 @@ module.exports = {
|
||||||
sourceMap: true
|
sourceMap: true
|
||||||
}),
|
}),
|
||||||
new CleanWebpackPlugin(['dist/public']),
|
new CleanWebpackPlugin(['dist/public']),
|
||||||
new ContextReplacementPlugin(/moment[\/\\]locale$/, /en/)
|
new IgnorePlugin(/^\.\/locale$/, /moment$/),
|
||||||
// new BundleAnalyzerPlugin()
|
// new BundleAnalyzerPlugin()
|
||||||
|
new LodashModuleReplacementPlugin()
|
||||||
],
|
],
|
||||||
optimization: {
|
optimization: {
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
|
|
|
@ -5396,6 +5396,13 @@ locate-path@^3.0.0:
|
||||||
p-locate "^3.0.0"
|
p-locate "^3.0.0"
|
||||||
path-exists "^3.0.0"
|
path-exists "^3.0.0"
|
||||||
|
|
||||||
|
lodash-webpack-plugin@^0.11.5:
|
||||||
|
version "0.11.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/lodash-webpack-plugin/-/lodash-webpack-plugin-0.11.5.tgz#c4bd064b4f561c3f823fa5982bdeb12c475390b9"
|
||||||
|
integrity sha512-QWfEIYxpixOdbd6KBe5g6MDWcyTgP3trDXwKHFqTlXrWiLcs/67fGQ0IWeRyhWlTITQIgMpJAYd2oeIztuV5VA==
|
||||||
|
dependencies:
|
||||||
|
lodash "^4.17.4"
|
||||||
|
|
||||||
lodash._basecopy@^3.0.0:
|
lodash._basecopy@^3.0.0:
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
|
resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
|
||||||
|
@ -5591,7 +5598,7 @@ lodash@^4.17.10:
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
|
||||||
integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==
|
integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==
|
||||||
|
|
||||||
lodash@^4.17.3, lodash@^4.17.5, lodash@~4.17.4:
|
lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.4:
|
||||||
version "4.17.11"
|
version "4.17.11"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
|
||||||
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
|
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
|
||||||
|
|
Loading…
Reference in New Issue