File tree Expand file tree Collapse file tree 5 files changed +21
-1
lines changed
angular_devkit/build_angular
src/angular-cli-files/models Expand file tree Collapse file tree 5 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 836836 "ngswConfigPath" : {
837837 "type" : " string" ,
838838 "description" : " Path to ngsw-config.json."
839+ },
840+ "autoBundleWorkerModules" : {
841+ "type" : " boolean" ,
842+ "description" : " Automatically bundle new Worker('..', { type:'module' })" ,
843+ "default" : true
839844 },
840845 "skipAppShell" : {
841846 "type" : " boolean" ,
Original file line number Diff line number Diff line change 5151 "webpack-dev-server" : " 3.2.1" ,
5252 "webpack-merge" : " 4.2.1" ,
5353 "webpack-sources" : " 1.3.0" ,
54- "webpack-subresource-integrity" : " 1.1.0-rc.6"
54+ "webpack-subresource-integrity" : " 1.1.0-rc.6" ,
55+ "worker-plugin" : " ^3.1.0"
5556 },
5657 "devDependencies" : {
5758 "@angular/animations" : " ^8.0.0-beta.10" ,
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ export interface BuildOptions {
5454 namedChunks ?: boolean ;
5555 subresourceIntegrity ?: boolean ;
5656 serviceWorker ?: boolean ;
57+ autoBundleWorkerModules ?: boolean ;
5758 skipAppShell ?: boolean ;
5859 statsJson : boolean ;
5960 forkTypeChecker : boolean ;
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ const ProgressPlugin = require('webpack/lib/ProgressPlugin');
2828const CircularDependencyPlugin = require ( 'circular-dependency-plugin' ) ;
2929const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
3030const StatsPlugin = require ( 'stats-webpack-plugin' ) ;
31+ const WorkerPlugin = require ( 'worker-plugin' ) ;
3132
3233
3334// tslint:disable-next-line:no-any
@@ -133,6 +134,11 @@ export function getCommonConfig(wco: WebpackConfigOptions): Configuration {
133134 } ) ;
134135 }
135136
137+ if ( buildOptions . autoBundleWorkerModules ) {
138+ const workerPluginInstance = new WorkerPlugin ( { globalObject : false } ) ;
139+ extraPlugins . push ( workerPluginInstance ) ;
140+ }
141+
136142 // process asset entries
137143 if ( buildOptions . assets ) {
138144 const copyWebpackPluginPatterns = buildOptions . assets . map ( ( asset : AssetPatternClass ) => {
Original file line number Diff line number Diff line change @@ -9890,6 +9890,13 @@ worker-farm@^1.5.2:
98909890 dependencies :
98919891 errno "~0.1.7"
98929892
9893+ worker-plugin@^3.1.0 :
9894+ version "3.1.0"
9895+ resolved "https://registry.yarnpkg.com/worker-plugin/-/worker-plugin-3.1.0.tgz#6311778f3514a87c273510ee3f809cc3fe161e6f"
9896+ integrity sha512-iQ9KTTmmN5fhfc2KMR7CcDblvcrg1QQ4pXymqZ3cRZF8L0890YLBcEqlIsGPdxoFwghyN8RA1pCEhCKuTF4Lkw==
9897+ dependencies :
9898+ loader-utils "^1.1.0"
9899+
98939900wrap-ansi@^2.0.0 :
98949901 version "2.1.0"
98959902 resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
You can’t perform that action at this time.
0 commit comments