File tree 4 files changed +12
-4
lines changed
packages/angular_devkit/build_angular/src
angular-cli-files/models/webpack-configs
4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,12 @@ const WorkerPlugin = require('worker-plugin');
15
15
16
16
export function getWorkerConfig ( wco : WebpackConfigOptions ) : Configuration {
17
17
const { buildOptions } = wco ;
18
+
18
19
if ( ! buildOptions . webWorkerTsConfig ) {
20
+ return { } ;
21
+ }
22
+
23
+ if ( typeof buildOptions . webWorkerTsConfig != 'string' ) {
19
24
throw new Error ( 'The `webWorkerTsConfig` must be a string.' ) ;
20
25
}
21
26
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ export function buildWebpackConfig(
155
155
getBrowserConfig ( wco ) ,
156
156
getStylesConfig ( wco ) ,
157
157
getStatsConfig ( wco ) ,
158
+ getWorkerConfig ( wco ) ,
158
159
] ;
159
160
160
161
if ( wco . buildOptions . main || wco . buildOptions . polyfills ) {
@@ -179,10 +180,6 @@ export function buildWebpackConfig(
179
180
} ) ;
180
181
}
181
182
182
- if ( wco . buildOptions . webWorkerTsConfig ) {
183
- webpackConfigs . push ( getWorkerConfig ( wco ) ) ;
184
- }
185
-
186
183
const webpackConfig = webpackMerge ( webpackConfigs ) ;
187
184
188
185
if ( options . profile || process . env [ 'NG_BUILD_PROFILING' ] ) {
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
15
15
getNonAotConfig ,
16
16
getStylesConfig ,
17
17
getTestConfig ,
18
+ getWorkerConfig ,
18
19
} from '../angular-cli-files/models/webpack-configs' ;
19
20
import { Schema as BrowserBuilderOptions } from '../browser/schema' ;
20
21
import { generateBrowserWebpackConfigFromContext } from '../utils/webpack-browser-config' ;
@@ -44,6 +45,7 @@ async function initialize(
44
45
getStylesConfig ( wco ) ,
45
46
getNonAotConfig ( wco ) ,
46
47
getTestConfig ( wco ) ,
48
+ getWorkerConfig ( wco ) ,
47
49
] ,
48
50
) ;
49
51
Original file line number Diff line number Diff line change 185
185
"items" : {
186
186
"type" : " string"
187
187
}
188
+ },
189
+ "webWorkerTsConfig" : {
190
+ "type" : " string" ,
191
+ "description" : " TypeScript configuration for Web Worker modules."
188
192
}
189
193
},
190
194
"additionalProperties" : false ,
You can’t perform that action at this time.
0 commit comments