File tree 5 files changed +21
-1
lines changed
angular_devkit/build_angular
src/angular-cli-files/models
5 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 836
836
"ngswConfigPath" : {
837
837
"type" : " string" ,
838
838
"description" : " Path to ngsw-config.json."
839
+ },
840
+ "autoBundleWorkerModules" : {
841
+ "type" : " boolean" ,
842
+ "description" : " Automatically bundle new Worker('..', { type:'module' })" ,
843
+ "default" : true
839
844
},
840
845
"skipAppShell" : {
841
846
"type" : " boolean" ,
Original file line number Diff line number Diff line change 49
49
"webpack-dev-server" : " 3.2.1" ,
50
50
"webpack-merge" : " 4.2.1" ,
51
51
"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"
53
54
},
54
55
"optionalDependencies" : {
55
56
"node-sass" : " 4.11.0"
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ export interface BuildOptions {
54
54
namedChunks ?: boolean ;
55
55
subresourceIntegrity ?: boolean ;
56
56
serviceWorker ?: boolean ;
57
+ autoBundleWorkerModules ?: boolean ;
57
58
skipAppShell ?: boolean ;
58
59
statsJson : boolean ;
59
60
forkTypeChecker : boolean ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ const ProgressPlugin = require('webpack/lib/ProgressPlugin');
22
22
const CircularDependencyPlugin = require ( 'circular-dependency-plugin' ) ;
23
23
const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
24
24
const StatsPlugin = require ( 'stats-webpack-plugin' ) ;
25
+ const WorkerPlugin = require ( 'worker-plugin' ) ;
25
26
26
27
27
28
// tslint:disable-next-line:no-any
@@ -127,6 +128,11 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
127
128
} ) ;
128
129
}
129
130
131
+ if ( buildOptions . autoBundleWorkerModules ) {
132
+ const workerPluginInstance = new WorkerPlugin ( { globalObject : false } ) ;
133
+ extraPlugins . push ( workerPluginInstance ) ;
134
+ }
135
+
130
136
// process asset entries
131
137
if ( buildOptions . assets ) {
132
138
const copyWebpackPluginPatterns = buildOptions . assets . map ( ( asset : AssetPatternClass ) => {
Original file line number Diff line number Diff line change @@ -10779,6 +10779,13 @@ worker-farm@^1.5.2:
10779
10779
dependencies :
10780
10780
errno "~0.1.7"
10781
10781
10782
+ worker-plugin@^3.1.0 :
10783
+ version "3.1.0"
10784
+ resolved "https://registry.yarnpkg.com/worker-plugin/-/worker-plugin-3.1.0.tgz#6311778f3514a87c273510ee3f809cc3fe161e6f"
10785
+ integrity sha512-iQ9KTTmmN5fhfc2KMR7CcDblvcrg1QQ4pXymqZ3cRZF8L0890YLBcEqlIsGPdxoFwghyN8RA1pCEhCKuTF4Lkw==
10786
+ dependencies :
10787
+ loader-utils "^1.1.0"
10788
+
10782
10789
wrap-ansi@^2.0.0 :
10783
10790
version "2.1.0"
10784
10791
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