File tree Expand file tree Collapse file tree 5 files changed +21
-2
lines changed
angular_devkit/build_angular
src/angular-cli-files/models Expand file tree Collapse file tree 5 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 835835 "ngswConfigPath" : {
836836 "type" : " string" ,
837837 "description" : " Path to ngsw-config.json."
838+ },
839+ "autoBundleWorkerModules" : {
840+ "type" : " boolean" ,
841+ "description" : " Automatically bundle new Worker('..', { type:'module' })" ,
842+ "default" : true
838843 },
839844 "skipAppShell" : {
840845 "type" : " boolean" ,
Original file line number Diff line number Diff line change 4949 "webpack-dev-server" : " 3.1.14" ,
5050 "webpack-merge" : " 4.2.1" ,
5151 "webpack-sources" : " 1.3.0" ,
52- "webpack-subresource-integrity" : " 1.1.0-rc.6"
52+ "webpack-subresource-integrity" : " 1.1.0-rc.6" ,
53+ "worker-plugin" : " ^3.0.0"
5354 },
5455 "optionalDependencies" : {
5556 "node-sass" : " 4.11.0"
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 @@ -23,6 +23,7 @@ const ProgressPlugin = require('webpack/lib/ProgressPlugin');
2323const CircularDependencyPlugin = require ( 'circular-dependency-plugin' ) ;
2424const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
2525const StatsPlugin = require ( 'stats-webpack-plugin' ) ;
26+ const WorkerPlugin = require ( 'worker-plugin' ) ;
2627
2728
2829// tslint:disable-next-line:no-any
@@ -128,6 +129,11 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
128129 } ) ;
129130 }
130131
132+ if ( buildOptions . autoBundleWorkerModules ) {
133+ const workerPluginInstance = new WorkerPlugin ( ) ;
134+ extraPlugins . push ( workerPluginInstance ) ;
135+ }
136+
131137 // process asset entries
132138 if ( buildOptions . assets ) {
133139 const copyWebpackPluginPatterns = buildOptions . assets . map ( ( asset : AssetPatternObject ) => {
Original file line number Diff line number Diff line change @@ -6083,7 +6083,6 @@ loglevel@^1.4.1:
60836083
60846084" long@git://github.com/dcodeIO/long.js.git#8181a6b50a2a230f0b2a1e4c4093f9b9d19c8b69 " :
60856085 version "4.0.1"
6086- uid "8181a6b50a2a230f0b2a1e4c4093f9b9d19c8b69"
60876086 resolved "git://github.com/dcodeIO/long.js.git#8181a6b50a2a230f0b2a1e4c4093f9b9d19c8b69"
60886087
60896088long@~3 :
@@ -10719,6 +10718,13 @@ worker-farm@^1.5.2:
1071910718 dependencies :
1072010719 errno "~0.1.7"
1072110720
10721+ worker-plugin@^3.0.0 :
10722+ version "3.0.0"
10723+ resolved "https://registry.yarnpkg.com/worker-plugin/-/worker-plugin-3.0.0.tgz#70a64e732b3bf575ad5981071bc5f010dadd6f95"
10724+ integrity sha512-iLcZBwR3TZO2A8s4S+VNzvuCvAHeZx84IR/zE8O89E+VBTTdn73cwDaUoCroftwtW1Qo0mMxYkJqwf0hyFwmeA==
10725+ dependencies :
10726+ loader-utils "^1.1.0"
10727+
1072210728wrap-ansi@^2.0.0 :
1072310729 version "2.1.0"
1072410730 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