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 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.1.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 @@ -22,6 +22,7 @@ const ProgressPlugin = require('webpack/lib/ProgressPlugin');
2222const CircularDependencyPlugin = require ( 'circular-dependency-plugin' ) ;
2323const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
2424const StatsPlugin = require ( 'stats-webpack-plugin' ) ;
25+ const WorkerPlugin = require ( 'worker-plugin' ) ;
2526
2627
2728// tslint:disable-next-line:no-any
@@ -127,6 +128,11 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
127128 } ) ;
128129 }
129130
131+ if ( buildOptions . autoBundleWorkerModules ) {
132+ const workerPluginInstance = new WorkerPlugin ( { globalObject : false } ) ;
133+ extraPlugins . push ( workerPluginInstance ) ;
134+ }
135+
130136 // process asset entries
131137 if ( buildOptions . assets ) {
132138 const copyWebpackPluginPatterns = buildOptions . assets . map ( ( asset : AssetPatternObject ) => {
Original file line number Diff line number Diff line change @@ -10777,6 +10777,13 @@ worker-farm@^1.5.2:
1077710777 dependencies :
1077810778 errno "~0.1.7"
1077910779
10780+ worker-plugin@^3.1.0 :
10781+ version "3.1.0"
10782+ resolved "https://registry.yarnpkg.com/worker-plugin/-/worker-plugin-3.1.0.tgz#6311778f3514a87c273510ee3f809cc3fe161e6f"
10783+ integrity sha512-iQ9KTTmmN5fhfc2KMR7CcDblvcrg1QQ4pXymqZ3cRZF8L0890YLBcEqlIsGPdxoFwghyN8RA1pCEhCKuTF4Lkw==
10784+ dependencies :
10785+ loader-utils "^1.1.0"
10786+
1078010787wrap-ansi@^2.0.0 :
1078110788 version "2.1.0"
1078210789 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