File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed
angular_devkit/build_angular
src/angular-cli-files/models Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 752752 "description" : " Generates a service worker config for production builds." ,
753753 "default" : false
754754 },
755+ "autoBundleWorkerModules" : {
756+ "type" : " boolean" ,
757+ "description" : " Automatically bundle new Worker('..', { type:'module' })" ,
758+ "default" : true
759+ },
755760 "skipAppShell" : {
756761 "type" : " boolean" ,
757762 "description" : " Flag to prevent building an app shell." ,
Original file line number Diff line number Diff line change 2727 "loader-utils" : " 1.1.0" ,
2828 "mini-css-extract-plugin" : " 0.4.3" ,
2929 "minimatch" : " 3.0.4" ,
30- "parse5" : " 4.0.0" ,
3130 "opn" : " 5.3.0" ,
31+ "parse5" : " 4.0.0" ,
3232 "portfinder" : " 1.0.17" ,
3333 "postcss" : " 6.0.23" ,
3434 "postcss-import" : " 11.1.0" ,
3737 "rxjs" : " 6.3.3" ,
3838 "sass-loader" : " 7.1.0" ,
3939 "semver" : " 5.5.1" ,
40- "source-map-support" : " 0.5.9" ,
4140 "source-map-loader" : " 0.2.4" ,
41+ "source-map-support" : " 0.5.9" ,
4242 "speed-measure-webpack-plugin" : " ^1.2.3" ,
4343 "stats-webpack-plugin" : " 0.7.0" ,
4444 "style-loader" : " 0.23.0" ,
4545 "stylus" : " 0.54.5" ,
4646 "stylus-loader" : " 3.0.2" ,
47- "tree-kill" : " 1.2.0" ,
4847 "terser-webpack-plugin" : " 1.1.0" ,
48+ "tree-kill" : " 1.2.0" ,
4949 "webpack" : " 4.19.1" ,
5050 "webpack-dev-middleware" : " 3.3.0" ,
5151 "webpack-dev-server" : " 3.1.8" ,
5252 "webpack-merge" : " 4.1.4" ,
5353 "webpack-sources" : " 1.2.0" ,
54- "webpack-subresource-integrity" : " 1.1.0-rc.6"
54+ "webpack-subresource-integrity" : " 1.1.0-rc.6" ,
55+ "worker-plugin" : " ^1.1.1"
5556 },
5657 "optionalDependencies" : {
5758 "node-sass" : " 4.9.3"
8788 "protractor" : " ~5.4.0" ,
8889 "zone.js" : " ^0.8.19"
8990 }
90- }
91+ }
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export interface BuildOptions {
4949 namedChunks ?: boolean ;
5050 subresourceIntegrity ?: boolean ;
5151 serviceWorker ?: boolean ;
52+ autoBundleWorkerModules ?: boolean ;
5253 skipAppShell ?: boolean ;
5354 statsJson : boolean ;
5455 forkTypeChecker : boolean ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const ProgressPlugin = require('webpack/lib/ProgressPlugin');
2626const CircularDependencyPlugin = require ( 'circular-dependency-plugin' ) ;
2727const TerserPlugin = require ( 'terser-webpack-plugin' ) ;
2828const StatsPlugin = require ( 'stats-webpack-plugin' ) ;
29+ const WorkerPlugin = require ( 'worker-plugin' ) ;
2930
3031/**
3132 * Enumerate loaders and their dependencies from this file to let the dependency validator
@@ -120,6 +121,11 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
120121 } ) ;
121122 }
122123
124+ if ( buildOptions . autoBundleWorkerModules ) {
125+ const workerPluginInstance = new WorkerPlugin ( ) ;
126+ extraPlugins . push ( workerPluginInstance ) ;
127+ }
128+
123129 // process asset entries
124130 if ( buildOptions . assets ) {
125131 const copyWebpackPluginPatterns = buildOptions . assets . map ( ( asset : AssetPatternObject ) => {
You can’t perform that action at this time.
0 commit comments