Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/angular/cli/lib/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,11 @@
"description": "Generates a service worker config for production builds.",
"default": false
},
"autoBundleWorkerModules": {
"type": "boolean",
"description": "Automatically bundle new Worker('..', { type:'module' })",
"default": true
},
"skipAppShell": {
"type": "boolean",
"description": "Flag to prevent building an app shell.",
Expand Down
7 changes: 3 additions & 4 deletions packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"loader-utils": "1.1.0",
"mini-css-extract-plugin": "0.4.4",
"minimatch": "3.0.4",
"parse5": "4.0.0",
"opn": "5.3.0",
"parse5": "4.0.0",
"portfinder": "1.0.17",
"postcss": "7.0.5",
"postcss-import": "12.0.0",
Expand All @@ -37,21 +37,20 @@
"rxjs": "6.3.3",
"sass-loader": "7.1.0",
"semver": "5.5.1",
"source-map-support": "0.5.9",
"source-map-loader": "0.2.4",
"speed-measure-webpack-plugin": "1.2.3",
"stats-webpack-plugin": "0.7.0",
"style-loader": "0.23.1",
"stylus": "0.54.5",
"stylus-loader": "3.0.2",
"tree-kill": "1.2.0",
"terser-webpack-plugin": "1.1.0",
"webpack": "4.22.0",
"webpack-dev-middleware": "3.4.0",
"webpack-dev-server": "3.1.10",
"webpack-merge": "4.1.4",
"webpack-sources": "1.3.0",
"webpack-subresource-integrity": "1.1.0-rc.6"
"webpack-subresource-integrity": "1.1.0-rc.6",
"worker-plugin": "^1.1.1"
},
"optionalDependencies": {
"node-sass": "4.9.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export interface BuildOptions {
namedChunks?: boolean;
subresourceIntegrity?: boolean;
serviceWorker?: boolean;
autoBundleWorkerModules?: boolean;
skipAppShell?: boolean;
statsJson: boolean;
forkTypeChecker: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const ProgressPlugin = require('webpack/lib/ProgressPlugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const StatsPlugin = require('stats-webpack-plugin');
const WorkerPlugin = require('worker-plugin');


// tslint:disable-next-line:no-any
Expand Down Expand Up @@ -110,6 +111,11 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
});
}

if (buildOptions.autoBundleWorkerModules) {
const workerPluginInstance = new WorkerPlugin();
extraPlugins.push(workerPluginInstance);
}

// process asset entries
if (buildOptions.assets) {
const copyWebpackPluginPatterns = buildOptions.assets.map((asset: AssetPatternObject) => {
Expand Down