Skip to content

Commit

Permalink
feat: added runtimeChunk config option (#266)
Browse files Browse the repository at this point in the history
* refactor: added runtimeChunk config option

* test: updated snapshot
  • Loading branch information
exreplay committed Oct 10, 2020
1 parent 07983e6 commit 1c27581
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Object {
"process": Object {
"env": Object {},
},
"runtimeChunk": "single",
"server": false,
"sw": false,
"transpileDependencies": Array [],
Expand Down
2 changes: 2 additions & 0 deletions packages/@averjs/config/lib/configs/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface AverWebpackConfig {
[index: string]: any;
}
};
runtimeChunk?: boolean | 'single' | 'multiple' | Config.RuntimeChunk,
css?: {
extract?: boolean,
styleResources?: {
Expand Down Expand Up @@ -51,6 +52,7 @@ export default (): AverWebpackConfig => ({
additionalExtensions: [ 'js' ],
transpileDependencies: [],
postcss: {},
runtimeChunk: 'single',
css: {
extract: process.env.NODE_ENV === 'production',
styleResources: {
Expand Down
2 changes: 2 additions & 0 deletions packages/@averjs/renderer/lib/config/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export default class WebpackClientConfiguration extends WebpackBaseConfiguration
enforce: true
};
}

if (this.webpackConfig.runtimeChunk) this.chainConfig.optimization.runtimeChunk(this.webpackConfig.runtimeChunk);

this.chainConfig.optimization
.splitChunks(splitChunks);
Expand Down

0 comments on commit 1c27581

Please sign in to comment.