Skip to content

Commit ad01261

Browse files
author
Angular Builds
committed
3a4461148 refactor(@angular-devkit/build-angular): initial copy-on-write asset processing support (#15788)
1 parent 7916236 commit ad01261

25 files changed

+254
-639
lines changed

‎package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
22
"name": "@angular-devkit/build-angular",
3-
"version": "0.900.0-next.8+22.4749052",
3+
"version": "0.900.0-next.8+14.3a44611",
44
"description": "Angular Webpack Build Facade",
55
"experimental": true,
66
"main": "src/index.js",
77
"typings": "src/index.d.ts",
88
"builders": "builders.json",
99
"dependencies": {
10-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#47490527f",
11-
"@angular-devkit/build-optimizer": "github:angular/angular-devkit-build-optimizer-builds#47490527f",
12-
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#47490527f",
13-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#47490527f",
10+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#3a4461148",
11+
"@angular-devkit/build-optimizer": "github:angular/angular-devkit-build-optimizer-builds#3a4461148",
12+
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#3a4461148",
13+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#3a4461148",
1414
"@babel/core": "7.6.3",
1515
"@babel/preset-env": "7.6.3",
16-
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#47490527f",
16+
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#3a4461148",
1717
"ajv": "6.10.2",
18-
"autoprefixer": "9.6.4",
18+
"autoprefixer": "9.6.1",
1919
"browserslist": "4.7.0",
2020
"cacache": "13.0.1",
2121
"caniuse-lite": "1.0.30000999",
@@ -42,7 +42,6 @@
4242
"postcss-loader": "3.0.0",
4343
"raw-loader": "3.1.0",
4444
"regenerator-runtime": "0.13.3",
45-
"rollup": "1.21.4",
4645
"rxjs": "6.5.3",
4746
"sass": "1.23.0",
4847
"sass-loader": "8.0.0",
@@ -81,7 +80,7 @@
8180
"url": "https://github.com/angular/angular-cli.git"
8281
},
8382
"engines": {
84-
"node": ">= 10.13.0",
83+
"node": ">= 10.9.0",
8584
"npm": ">= 6.11.0",
8685
"pnpm": ">= 3.2.0",
8786
"yarn": ">= 1.13.0"

‎src/angular-cli-files/models/build-options.d.ts

+5-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { logging } from '@angular-devkit/core';
99
import { ParsedConfiguration } from '@angular/compiler-cli';
1010
import { ScriptTarget } from 'typescript';
11-
import { AssetPatternClass, Budget, ExtraEntryPoint, I18NMissingTranslation, Localize, OptimizationClass, SourceMapClass } from '../../browser/schema';
11+
import { AssetPatternClass, Budget, ExtraEntryPoint, OptimizationClass, SourceMapClass } from '../../browser/schema';
1212
import { NormalizedFileReplacement } from '../../utils/normalize-file-replacements';
1313
export interface BuildOptions {
1414
optimization: OptimizationClass;
@@ -17,29 +17,26 @@ export interface BuildOptions {
1717
resourcesOutputPath?: string;
1818
aot?: boolean;
1919
sourceMap: SourceMapClass;
20-
/** @deprecated since version 8. use sourceMap instead. */
20+
/** @deprecated use sourceMap instead */
2121
vendorSourceMap?: boolean;
22-
/** @deprecated since version 8 */
22+
/** @deprecated */
2323
evalSourceMap?: boolean;
2424
vendorChunk?: boolean;
2525
commonChunk?: boolean;
2626
baseHref?: string;
2727
deployUrl?: string;
2828
verbose?: boolean;
2929
progress?: boolean;
30-
/** @deprecated since version 9. Use 'locales' object in the project metadata instead.*/
3130
i18nFile?: string;
32-
/** @deprecated since version 9. No longer needed as the format will be determined automatically.*/
3331
i18nFormat?: string;
34-
/** @deprecated since version 9. Use 'localize' instead.*/
3532
i18nLocale?: string;
36-
localize?: Localize;
37-
i18nMissingTranslation?: I18NMissingTranslation;
33+
i18nMissingTranslation?: string;
3834
extractCss?: boolean;
3935
bundleDependencies?: 'none' | 'all';
4036
watch?: boolean;
4137
outputHashing?: string;
4238
poll?: number;
39+
app?: string;
4340
deleteOutputPath?: boolean;
4441
preserveSymlinks?: boolean;
4542
extractLicenses?: boolean;
@@ -49,12 +46,10 @@ export interface BuildOptions {
4946
subresourceIntegrity?: boolean;
5047
serviceWorker?: boolean;
5148
webWorkerTsConfig?: string;
52-
/** @deprecated since version 8 **/
5349
skipAppShell?: boolean;
5450
statsJson: boolean;
5551
forkTypeChecker: boolean;
5652
profile?: boolean;
57-
/** @deprecated since version 8 **/
5853
es5BrowserSupport?: boolean;
5954
main: string;
6055
polyfills?: string;
@@ -73,7 +68,6 @@ export interface BuildOptions {
7368
rebaseRootRelativeCssUrls?: boolean;
7469
esVersionInFileName?: boolean;
7570
scriptTargetOverride?: ScriptTarget;
76-
experimentalRollupPass?: boolean;
7771
}
7872
export interface WebpackTestOptions extends BuildOptions {
7973
codeCoverage?: boolean;

‎src/angular-cli-files/models/webpack-configs/common.js

+1-43
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const bundle_budget_1 = require("../../plugins/bundle-budget");
2020
const cleancss_webpack_plugin_1 = require("../../plugins/cleancss-webpack-plugin");
2121
const named_chunks_plugin_1 = require("../../plugins/named-chunks-plugin");
2222
const scripts_webpack_plugin_1 = require("../../plugins/scripts-webpack-plugin");
23-
const webpack_2 = require("../../plugins/webpack");
2423
const find_up_1 = require("../../utilities/find-up");
2524
const utils_2 = require("./utils");
2625
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
@@ -39,50 +38,10 @@ function getCommonConfig(wco) {
3938
}
4039
// tslint:disable-next-line:no-any
4140
const extraPlugins = [];
42-
const extraRules = [];
4341
const entryPoints = {};
4442
const targetInFileName = utils_2.getEsVersionForFileName(utils_1.fullDifferential ? buildOptions.scriptTargetOverride : tsConfig.options.target, buildOptions.esVersionInFileName);
4543
if (buildOptions.main) {
46-
const mainPath = path.resolve(root, buildOptions.main);
47-
entryPoints['main'] = [mainPath];
48-
if (buildOptions.experimentalRollupPass) {
49-
// NOTE: the following are known problems with experimentalRollupPass
50-
// - vendorChunk, commonChunk, namedChunks: these won't work, because by the time webpack
51-
// sees the chunks, the context of where they came from is lost.
52-
// - webWorkerTsConfig: workers must be imported via a root relative path (e.g.
53-
// `app/search/search.worker`) instead of a relative path (`/search.worker`) because
54-
// of the same reason as above.
55-
// - loadChildren string syntax: doesn't work because rollup cannot follow the imports.
56-
// Rollup options, except entry module, which is automatically inferred.
57-
const rollupOptions = {};
58-
// Add rollup plugins/rules.
59-
extraRules.push({
60-
test: mainPath,
61-
// Ensure rollup loader executes after other loaders.
62-
enforce: 'post',
63-
use: [{
64-
loader: webpack_2.WebpackRollupLoader,
65-
options: rollupOptions,
66-
}],
67-
});
68-
// Rollup bundles will include the dynamic System.import that was inside Angular and webpack
69-
// will emit warnings because it can't resolve it. We just ignore it.
70-
// TODO: maybe use https://webpack.js.org/configuration/stats/#statswarningsfilter instead.
71-
// Ignore all "Critical dependency: the request of a dependency is an expression" warnings.
72-
extraPlugins.push(new webpack_1.ContextReplacementPlugin(/./));
73-
// Ignore "System.import() is deprecated" warnings for the main file and js files.
74-
// Might still get them if @angular/core gets split into a lazy module.
75-
extraRules.push({
76-
test: mainPath,
77-
enforce: 'post',
78-
parser: { system: true },
79-
});
80-
extraRules.push({
81-
test: /\.js$/,
82-
enforce: 'post',
83-
parser: { system: true },
84-
});
85-
}
44+
entryPoints['main'] = [path.resolve(root, buildOptions.main)];
8645
}
8746
let differentialLoadingNeeded = false;
8847
if (wco.buildOptions.platform !== 'server') {
@@ -431,7 +390,6 @@ function getCommonConfig(wco) {
431390
enforce: 'pre',
432391
...sourceMapUseRule,
433392
},
434-
...extraRules,
435393
],
436394
},
437395
optimization: {

‎src/angular-cli-files/plugins/webpack-rollup-loader.d.ts

-10
This file was deleted.

‎src/angular-cli-files/plugins/webpack-rollup-loader.js

-113
This file was deleted.

‎src/angular-cli-files/plugins/webpack.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ export { RemoveHashPlugin, RemoveHashPluginOptions } from './remove-hash-plugin'
1313
export { NamedLazyChunksPlugin as NamedChunksPlugin } from './named-chunks-plugin';
1414
export { default as PostcssCliResources, PostcssCliResourcesOptions, } from './postcss-cli-resources';
1515
export declare const RawCssLoader: string;
16-
export declare const WebpackRollupLoader: string;

‎src/angular-cli-files/plugins/webpack.js

-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ var postcss_cli_resources_1 = require("./postcss-cli-resources");
2424
exports.PostcssCliResources = postcss_cli_resources_1.default;
2525
const path_1 = require("path");
2626
exports.RawCssLoader = require.resolve(path_1.join(__dirname, 'raw-css-loader'));
27-
exports.WebpackRollupLoader = require.resolve(path_1.join(__dirname, 'webpack-rollup-loader'));

‎src/browser/action-cache.d.ts

-17
This file was deleted.

0 commit comments

Comments
 (0)