build(webpack): bundle size optimization for lodash (#6244)
* add duplicate code detection check for general purpose use * webpack alias for lodash * redux and react-redux dependency bump that removes lodash dependencies * lodash version match with swagger-client and recent security update * additional webpack config to help reduce build sizes * restore max bundle size back to 1024000
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
import path from "path"
|
||||
|
||||
import configBuilder from "./_config-builder"
|
||||
import { DuplicatesPlugin } from "inspectpack/plugin"
|
||||
import LodashModuleReplacementPlugin from "lodash-webpack-plugin"
|
||||
import { WebpackBundleSizeAnalyzerPlugin } from "webpack-bundle-size-analyzer"
|
||||
|
||||
const result = configBuilder(
|
||||
{
|
||||
@@ -20,10 +21,19 @@ const result = configBuilder(
|
||||
"./src/core/index.js",
|
||||
],
|
||||
},
|
||||
|
||||
output: {
|
||||
library: "SwaggerUIBundle",
|
||||
},
|
||||
plugins: [
|
||||
new DuplicatesPlugin({
|
||||
// emit compilation warning or error? (Default: `false`)
|
||||
emitErrors: false,
|
||||
// display full duplicates information? (Default: `false`)
|
||||
verbose: false,
|
||||
}),
|
||||
new LodashModuleReplacementPlugin(),
|
||||
new WebpackBundleSizeAnalyzerPlugin("log.bundle-sizes.swagger-ui.txt"),
|
||||
]
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user