mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add splitChunks plugin and its configs
Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
This commit is contained in:
parent
8dfe991adc
commit
bcfa00aea5
@ -36,6 +36,15 @@ export default function (): webpack.Configuration {
|
||||
externals: nodeExternals(),
|
||||
optimization: {
|
||||
minimize: isProduction,
|
||||
// Automatically split vendor and commons in development
|
||||
// (for faster re-compiling)
|
||||
// https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
|
||||
splitChunks: isDevelopment ? {
|
||||
chunks: "all",
|
||||
} : false,
|
||||
runtimeChunk: isDevelopment ? {
|
||||
name: (entrypoint: { name: string }) => `runtime-${entrypoint.name}`,
|
||||
} : false,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
||||
@ -79,6 +79,15 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura
|
||||
}
|
||||
})
|
||||
],
|
||||
// Automatically split vendor and commons in development
|
||||
// (for faster re-compiling)
|
||||
// https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
|
||||
splitChunks: isDevelopment ? {
|
||||
chunks: "all",
|
||||
}: false,
|
||||
runtimeChunk: isDevelopment ? {
|
||||
name: (entrypoint: { name: string }) => `runtime-${entrypoint.name}`,
|
||||
}: false,
|
||||
},
|
||||
|
||||
module: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user