@depup/ngtools__webpack 21.2.2-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +25 -0
- package/changes.json +5 -0
- package/index.d.ts +8 -0
- package/index.js +25 -0
- package/index.js.map +1 -0
- package/package.json +50 -0
- package/src/benchmark.d.ts +9 -0
- package/src/benchmark.js +27 -0
- package/src/benchmark.js.map +1 -0
- package/src/index.d.ts +8 -0
- package/src/index.js +19 -0
- package/src/index.js.map +1 -0
- package/src/ivy/cache.d.ts +14 -0
- package/src/ivy/cache.js +33 -0
- package/src/ivy/cache.js.map +1 -0
- package/src/ivy/diagnostics.d.ts +13 -0
- package/src/ivy/diagnostics.js +33 -0
- package/src/ivy/diagnostics.js.map +1 -0
- package/src/ivy/host.d.ts +32 -0
- package/src/ivy/host.js +226 -0
- package/src/ivy/host.js.map +1 -0
- package/src/ivy/index.d.ts +10 -0
- package/src/ivy/index.js +17 -0
- package/src/ivy/index.js.map +1 -0
- package/src/ivy/loader.d.ts +10 -0
- package/src/ivy/loader.js +95 -0
- package/src/ivy/loader.js.map +1 -0
- package/src/ivy/paths.d.ts +11 -0
- package/src/ivy/paths.js +70 -0
- package/src/ivy/paths.js.map +1 -0
- package/src/ivy/plugin.d.ts +53 -0
- package/src/ivy/plugin.js +556 -0
- package/src/ivy/plugin.js.map +1 -0
- package/src/ivy/symbol.d.ts +25 -0
- package/src/ivy/symbol.js +45 -0
- package/src/ivy/symbol.js.map +1 -0
- package/src/ivy/system.d.ts +15 -0
- package/src/ivy/system.js +115 -0
- package/src/ivy/system.js.map +1 -0
- package/src/ivy/transformation.d.ts +18 -0
- package/src/ivy/transformation.js +137 -0
- package/src/ivy/transformation.js.map +1 -0
- package/src/loaders/inline-resource.d.ts +16 -0
- package/src/loaders/inline-resource.js +25 -0
- package/src/loaders/inline-resource.js.map +1 -0
- package/src/paths-plugin.d.ts +32 -0
- package/src/paths-plugin.js +255 -0
- package/src/paths-plugin.js.map +1 -0
- package/src/resource_loader.d.ts +29 -0
- package/src/resource_loader.js +321 -0
- package/src/resource_loader.js.map +1 -0
- package/src/transformers/elide_imports.d.ts +9 -0
- package/src/transformers/elide_imports.js +165 -0
- package/src/transformers/elide_imports.js.map +1 -0
- package/src/transformers/find_image_domains.d.ts +9 -0
- package/src/transformers/find_image_domains.js +132 -0
- package/src/transformers/find_image_domains.js.map +1 -0
- package/src/transformers/index.d.ts +9 -0
- package/src/transformers/index.js +26 -0
- package/src/transformers/index.js.map +1 -0
- package/src/transformers/remove-ivy-jit-support-calls.d.ts +9 -0
- package/src/transformers/remove-ivy-jit-support-calls.js +136 -0
- package/src/transformers/remove-ivy-jit-support-calls.js.map +1 -0
- package/src/transformers/replace_resources.d.ts +11 -0
- package/src/transformers/replace_resources.js +250 -0
- package/src/transformers/replace_resources.js.map +1 -0
- package/src/transformers/spec_helpers.d.ts +13 -0
- package/src/transformers/spec_helpers.js +89 -0
- package/src/transformers/spec_helpers.js.map +1 -0
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.AngularWebpackPlugin = exports.imageDomains = void 0;
|
|
44
|
+
const node_assert_1 = require("node:assert");
|
|
45
|
+
const ts = __importStar(require("typescript"));
|
|
46
|
+
const paths_plugin_1 = require("../paths-plugin");
|
|
47
|
+
const resource_loader_1 = require("../resource_loader");
|
|
48
|
+
const cache_1 = require("./cache");
|
|
49
|
+
const diagnostics_1 = require("./diagnostics");
|
|
50
|
+
const host_1 = require("./host");
|
|
51
|
+
const paths_1 = require("./paths");
|
|
52
|
+
const symbol_1 = require("./symbol");
|
|
53
|
+
const system_1 = require("./system");
|
|
54
|
+
const transformation_1 = require("./transformation");
|
|
55
|
+
/**
|
|
56
|
+
* The threshold used to determine whether Angular file diagnostics should optimize for full programs
|
|
57
|
+
* or single files. If the number of affected files for a build is more than the threshold, full
|
|
58
|
+
* program optimization will be used.
|
|
59
|
+
*/
|
|
60
|
+
const DIAGNOSTICS_AFFECTED_THRESHOLD = 1;
|
|
61
|
+
exports.imageDomains = new Set();
|
|
62
|
+
const PLUGIN_NAME = 'angular-compiler';
|
|
63
|
+
const compilationFileEmitters = new WeakMap();
|
|
64
|
+
class AngularWebpackPlugin {
|
|
65
|
+
pluginOptions;
|
|
66
|
+
compilerCliModule;
|
|
67
|
+
compilerCliToolingModule;
|
|
68
|
+
watchMode;
|
|
69
|
+
ngtscNextProgram;
|
|
70
|
+
builder;
|
|
71
|
+
sourceFileCache;
|
|
72
|
+
webpackCache;
|
|
73
|
+
webpackCreateHash;
|
|
74
|
+
fileDependencies = new Map();
|
|
75
|
+
requiredFilesToEmit = new Set();
|
|
76
|
+
requiredFilesToEmitCache = new Map();
|
|
77
|
+
fileEmitHistory = new Map();
|
|
78
|
+
constructor(options = {}) {
|
|
79
|
+
this.pluginOptions = {
|
|
80
|
+
emitClassMetadata: false,
|
|
81
|
+
emitNgModuleScope: false,
|
|
82
|
+
jitMode: false,
|
|
83
|
+
fileReplacements: {},
|
|
84
|
+
substitutions: {},
|
|
85
|
+
directTemplateLoading: true,
|
|
86
|
+
tsconfig: 'tsconfig.json',
|
|
87
|
+
...options,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
get compilerCli() {
|
|
91
|
+
// The compilerCliModule field is guaranteed to be defined during a compilation
|
|
92
|
+
// due to the `beforeCompile` hook. Usage of this property accessor prior to the
|
|
93
|
+
// hook execution is an implementation error.
|
|
94
|
+
node_assert_1.strict.ok(this.compilerCliModule, `'@angular/compiler-cli' used prior to Webpack compilation.`);
|
|
95
|
+
return this.compilerCliModule;
|
|
96
|
+
}
|
|
97
|
+
get compilerCliTooling() {
|
|
98
|
+
// The compilerCliToolingModule field is guaranteed to be defined during a compilation
|
|
99
|
+
// due to the `beforeCompile` hook. Usage of this property accessor prior to the
|
|
100
|
+
// hook execution is an implementation error.
|
|
101
|
+
node_assert_1.strict.ok(this.compilerCliToolingModule, `'@angular/compiler-cli' used prior to Webpack compilation.`);
|
|
102
|
+
return this.compilerCliToolingModule;
|
|
103
|
+
}
|
|
104
|
+
get options() {
|
|
105
|
+
return this.pluginOptions;
|
|
106
|
+
}
|
|
107
|
+
apply(compiler) {
|
|
108
|
+
const { NormalModuleReplacementPlugin, util } = compiler.webpack;
|
|
109
|
+
this.webpackCreateHash = util.createHash;
|
|
110
|
+
// Setup file replacements with webpack
|
|
111
|
+
for (const [key, value] of Object.entries(this.pluginOptions.fileReplacements)) {
|
|
112
|
+
new NormalModuleReplacementPlugin(new RegExp('^' + key.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&') + '$'), value).apply(compiler);
|
|
113
|
+
}
|
|
114
|
+
// Set resolver options
|
|
115
|
+
const pathsPlugin = new paths_plugin_1.TypeScriptPathsPlugin();
|
|
116
|
+
compiler.hooks.afterResolvers.tap(PLUGIN_NAME, (compiler) => {
|
|
117
|
+
compiler.resolverFactory.hooks.resolveOptions
|
|
118
|
+
.for('normal')
|
|
119
|
+
.tap(PLUGIN_NAME, (resolveOptions) => {
|
|
120
|
+
resolveOptions.plugins ??= [];
|
|
121
|
+
resolveOptions.plugins.push(pathsPlugin);
|
|
122
|
+
return resolveOptions;
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
// Load the compiler-cli if not already available
|
|
126
|
+
compiler.hooks.beforeCompile.tapPromise(PLUGIN_NAME, () => this.initializeCompilerCli());
|
|
127
|
+
const compilationState = { pathsPlugin };
|
|
128
|
+
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
|
129
|
+
try {
|
|
130
|
+
this.setupCompilation(compilation, compilationState);
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
(0, diagnostics_1.addError)(compilation, `Failed to initialize Angular compilation - ${error instanceof Error ? error.message : error}`);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
setupCompilation(compilation, state) {
|
|
138
|
+
const compiler = compilation.compiler;
|
|
139
|
+
// Register plugin to ensure deterministic emit order in multi-plugin usage
|
|
140
|
+
const emitRegistration = this.registerWithCompilation(compilation);
|
|
141
|
+
this.watchMode = compiler.watchMode;
|
|
142
|
+
// Initialize webpack cache
|
|
143
|
+
if (!this.webpackCache && compilation.options.cache) {
|
|
144
|
+
this.webpackCache = compilation.getCache(PLUGIN_NAME);
|
|
145
|
+
}
|
|
146
|
+
// Initialize the resource loader if not already setup
|
|
147
|
+
if (!state.resourceLoader) {
|
|
148
|
+
state.resourceLoader = new resource_loader_1.WebpackResourceLoader(this.watchMode);
|
|
149
|
+
}
|
|
150
|
+
// Setup and read TypeScript and Angular compiler configuration
|
|
151
|
+
const { compilerOptions, rootNames, errors } = this.loadConfiguration();
|
|
152
|
+
// Create diagnostics reporter and report configuration file errors
|
|
153
|
+
const diagnosticsReporter = (0, diagnostics_1.createDiagnosticsReporter)(compilation, (diagnostic) => this.compilerCli.formatDiagnostics([diagnostic]));
|
|
154
|
+
diagnosticsReporter(errors);
|
|
155
|
+
// Update TypeScript path mapping plugin with new configuration
|
|
156
|
+
state.pathsPlugin.update(compilerOptions);
|
|
157
|
+
// Create a Webpack-based TypeScript compiler host
|
|
158
|
+
const system = (0, system_1.createWebpackSystem)(
|
|
159
|
+
// Webpack lacks an InputFileSytem type definition with sync functions
|
|
160
|
+
compiler.inputFileSystem, (0, paths_1.normalizePath)(compiler.context));
|
|
161
|
+
const host = ts.createIncrementalCompilerHost(compilerOptions, system);
|
|
162
|
+
// Setup source file caching and reuse cache from previous compilation if present
|
|
163
|
+
let cache = this.sourceFileCache;
|
|
164
|
+
let changedFiles;
|
|
165
|
+
if (cache) {
|
|
166
|
+
changedFiles = new Set();
|
|
167
|
+
for (const changedFile of [
|
|
168
|
+
...(compiler.modifiedFiles ?? []),
|
|
169
|
+
...(compiler.removedFiles ?? []),
|
|
170
|
+
]) {
|
|
171
|
+
const normalizedChangedFile = (0, paths_1.normalizePath)(changedFile);
|
|
172
|
+
// Invalidate file dependencies
|
|
173
|
+
this.fileDependencies.delete(normalizedChangedFile);
|
|
174
|
+
// Invalidate existing cache
|
|
175
|
+
cache.invalidate(normalizedChangedFile);
|
|
176
|
+
changedFiles.add(normalizedChangedFile);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
// Initialize a new cache
|
|
181
|
+
cache = new cache_1.SourceFileCache();
|
|
182
|
+
// Only store cache if in watch mode
|
|
183
|
+
if (this.watchMode) {
|
|
184
|
+
this.sourceFileCache = cache;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
(0, host_1.augmentHostWithCaching)(host, cache);
|
|
188
|
+
const moduleResolutionCache = ts.createModuleResolutionCache(host.getCurrentDirectory(), host.getCanonicalFileName.bind(host), compilerOptions);
|
|
189
|
+
// Setup source file dependency collection
|
|
190
|
+
(0, host_1.augmentHostWithDependencyCollection)(host, this.fileDependencies, moduleResolutionCache);
|
|
191
|
+
// Setup resource loading
|
|
192
|
+
state.resourceLoader.update(compilation, changedFiles);
|
|
193
|
+
(0, host_1.augmentHostWithResources)(host, state.resourceLoader, {
|
|
194
|
+
directTemplateLoading: this.pluginOptions.directTemplateLoading,
|
|
195
|
+
inlineStyleFileExtension: this.pluginOptions.inlineStyleFileExtension,
|
|
196
|
+
});
|
|
197
|
+
// Setup source file adjustment options
|
|
198
|
+
(0, host_1.augmentHostWithReplacements)(host, this.pluginOptions.fileReplacements, moduleResolutionCache);
|
|
199
|
+
(0, host_1.augmentHostWithSubstitutions)(host, this.pluginOptions.substitutions);
|
|
200
|
+
// Create the file emitter used by the webpack loader
|
|
201
|
+
const { fileEmitter, builder, internalFiles } = this.pluginOptions.jitMode
|
|
202
|
+
? this.updateJitProgram(compilerOptions, rootNames, host, diagnosticsReporter)
|
|
203
|
+
: this.updateAotProgram(compilerOptions, rootNames, host, diagnosticsReporter, state.resourceLoader);
|
|
204
|
+
// Set of files used during the unused TypeScript file analysis
|
|
205
|
+
const currentUnused = new Set();
|
|
206
|
+
for (const sourceFile of builder.getSourceFiles()) {
|
|
207
|
+
if (internalFiles?.has(sourceFile)) {
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
// Ensure all program files are considered part of the compilation and will be watched.
|
|
211
|
+
// Webpack does not normalize paths. Therefore, we need to normalize the path with FS seperators.
|
|
212
|
+
compilation.fileDependencies.add((0, paths_1.externalizePath)(sourceFile.fileName));
|
|
213
|
+
// Add all non-declaration files to the initial set of unused files. The set will be
|
|
214
|
+
// analyzed and pruned after all Webpack modules are finished building.
|
|
215
|
+
if (!sourceFile.isDeclarationFile) {
|
|
216
|
+
currentUnused.add((0, paths_1.normalizePath)(sourceFile.fileName));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
compilation.hooks.finishModules.tapPromise(PLUGIN_NAME, async (modules) => {
|
|
220
|
+
// Rebuild any remaining AOT required modules
|
|
221
|
+
await this.rebuildRequiredFiles(modules, compilation, fileEmitter);
|
|
222
|
+
// Clear out the Webpack compilation to avoid an extra retaining reference
|
|
223
|
+
state.resourceLoader?.clearParentCompilation();
|
|
224
|
+
// Analyze program for unused files
|
|
225
|
+
if (compilation.errors.length > 0) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
for (const webpackModule of modules) {
|
|
229
|
+
const resource = webpackModule.resource;
|
|
230
|
+
if (resource) {
|
|
231
|
+
this.markResourceUsed((0, paths_1.normalizePath)(resource), currentUnused);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
for (const unused of currentUnused) {
|
|
235
|
+
if (state.previousUnused?.has(unused)) {
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
(0, diagnostics_1.addWarning)(compilation, `${unused} is part of the TypeScript compilation but it's unused.\n` +
|
|
239
|
+
`Add only entry points to the 'files' or 'include' properties in your tsconfig.`);
|
|
240
|
+
}
|
|
241
|
+
state.previousUnused = currentUnused;
|
|
242
|
+
});
|
|
243
|
+
// Store file emitter for loader usage
|
|
244
|
+
emitRegistration.update(fileEmitter);
|
|
245
|
+
}
|
|
246
|
+
registerWithCompilation(compilation) {
|
|
247
|
+
let fileEmitters = compilationFileEmitters.get(compilation);
|
|
248
|
+
if (!fileEmitters) {
|
|
249
|
+
fileEmitters = new symbol_1.FileEmitterCollection();
|
|
250
|
+
compilationFileEmitters.set(compilation, fileEmitters);
|
|
251
|
+
compilation.compiler.webpack.NormalModule.getCompilationHooks(compilation).loader.tap(PLUGIN_NAME, (context) => {
|
|
252
|
+
const loaderContext = context;
|
|
253
|
+
loaderContext[symbol_1.AngularPluginSymbol] = fileEmitters;
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
const emitRegistration = fileEmitters.register();
|
|
257
|
+
return emitRegistration;
|
|
258
|
+
}
|
|
259
|
+
markResourceUsed(normalizedResourcePath, currentUnused) {
|
|
260
|
+
if (!currentUnused.has(normalizedResourcePath)) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
currentUnused.delete(normalizedResourcePath);
|
|
264
|
+
const dependencies = this.fileDependencies.get(normalizedResourcePath);
|
|
265
|
+
if (!dependencies) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
for (const dependency of dependencies) {
|
|
269
|
+
this.markResourceUsed((0, paths_1.normalizePath)(dependency), currentUnused);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
async rebuildRequiredFiles(modules, compilation, fileEmitter) {
|
|
273
|
+
if (this.requiredFilesToEmit.size === 0) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
const filesToRebuild = new Set();
|
|
277
|
+
for (const requiredFile of this.requiredFilesToEmit) {
|
|
278
|
+
const history = await this.getFileEmitHistory(requiredFile);
|
|
279
|
+
if (history) {
|
|
280
|
+
const emitResult = await fileEmitter(requiredFile);
|
|
281
|
+
if (emitResult?.content === undefined ||
|
|
282
|
+
history.length !== emitResult.content.length ||
|
|
283
|
+
emitResult.hash === undefined ||
|
|
284
|
+
Buffer.compare(history.hash, emitResult.hash) !== 0) {
|
|
285
|
+
// New emit result is different so rebuild using new emit result
|
|
286
|
+
this.requiredFilesToEmitCache.set(requiredFile, emitResult);
|
|
287
|
+
filesToRebuild.add(requiredFile);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
// No emit history so rebuild
|
|
292
|
+
filesToRebuild.add(requiredFile);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (filesToRebuild.size > 0) {
|
|
296
|
+
const rebuild = (webpackModule) => new Promise((resolve) => compilation.rebuildModule(webpackModule, () => resolve()));
|
|
297
|
+
const modulesToRebuild = [];
|
|
298
|
+
for (const webpackModule of modules) {
|
|
299
|
+
const resource = webpackModule.resource;
|
|
300
|
+
if (resource && filesToRebuild.has((0, paths_1.normalizePath)(resource))) {
|
|
301
|
+
modulesToRebuild.push(webpackModule);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
await Promise.all(modulesToRebuild.map((webpackModule) => rebuild(webpackModule)));
|
|
305
|
+
}
|
|
306
|
+
this.requiredFilesToEmit.clear();
|
|
307
|
+
this.requiredFilesToEmitCache.clear();
|
|
308
|
+
}
|
|
309
|
+
loadConfiguration() {
|
|
310
|
+
const { options: compilerOptions, rootNames, errors, } = this.compilerCli.readConfiguration(this.pluginOptions.tsconfig, this.pluginOptions.compilerOptions);
|
|
311
|
+
compilerOptions.composite = false;
|
|
312
|
+
compilerOptions.noEmitOnError = false;
|
|
313
|
+
compilerOptions.suppressOutputPathCheck = true;
|
|
314
|
+
compilerOptions.outDir = undefined;
|
|
315
|
+
compilerOptions.inlineSources = compilerOptions.sourceMap;
|
|
316
|
+
compilerOptions.inlineSourceMap = false;
|
|
317
|
+
compilerOptions.mapRoot = undefined;
|
|
318
|
+
compilerOptions.sourceRoot = undefined;
|
|
319
|
+
compilerOptions.allowEmptyCodegenFiles = false;
|
|
320
|
+
compilerOptions.annotationsAs = 'decorators';
|
|
321
|
+
compilerOptions.enableResourceInlining = false;
|
|
322
|
+
return { compilerOptions, rootNames, errors };
|
|
323
|
+
}
|
|
324
|
+
updateAotProgram(compilerOptions, rootNames, host, diagnosticsReporter, resourceLoader) {
|
|
325
|
+
// Create the Angular specific program that contains the Angular compiler
|
|
326
|
+
const angularProgram = new this.compilerCli.NgtscProgram(rootNames, compilerOptions, host, this.ngtscNextProgram);
|
|
327
|
+
const angularCompiler = angularProgram.compiler;
|
|
328
|
+
// The `ignoreForEmit` return value can be safely ignored when emitting. Only files
|
|
329
|
+
// that will be bundled (requested by Webpack) will be emitted. Combined with TypeScript's
|
|
330
|
+
// eliding of type only imports, this will cause type only files to be automatically ignored.
|
|
331
|
+
// Internal Angular type check files are also not resolvable by the bundler. Even if they
|
|
332
|
+
// were somehow errantly imported, the bundler would error before an emit was attempted.
|
|
333
|
+
// Diagnostics are still collected for all files which requires using `ignoreForDiagnostics`.
|
|
334
|
+
const { ignoreForDiagnostics, ignoreForEmit } = angularCompiler;
|
|
335
|
+
// SourceFile versions are required for builder programs.
|
|
336
|
+
// The wrapped host inside NgtscProgram adds additional files that will not have versions.
|
|
337
|
+
const typeScriptProgram = angularProgram.getTsProgram();
|
|
338
|
+
(0, host_1.augmentProgramWithVersioning)(typeScriptProgram);
|
|
339
|
+
let builder;
|
|
340
|
+
if (this.watchMode) {
|
|
341
|
+
builder = this.builder = ts.createEmitAndSemanticDiagnosticsBuilderProgram(typeScriptProgram, host, this.builder);
|
|
342
|
+
this.ngtscNextProgram = angularProgram;
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
// When not in watch mode, the startup cost of the incremental analysis can be avoided by
|
|
346
|
+
// using an abstract builder that only wraps a TypeScript program.
|
|
347
|
+
builder = ts.createAbstractBuilder(typeScriptProgram, host);
|
|
348
|
+
}
|
|
349
|
+
// Update semantic diagnostics cache
|
|
350
|
+
const affectedFiles = new Set();
|
|
351
|
+
// Analyze affected files when in watch mode for incremental type checking
|
|
352
|
+
if ('getSemanticDiagnosticsOfNextAffectedFile' in builder) {
|
|
353
|
+
// eslint-disable-next-line no-constant-condition
|
|
354
|
+
while (true) {
|
|
355
|
+
const result = builder.getSemanticDiagnosticsOfNextAffectedFile(undefined, (sourceFile) => {
|
|
356
|
+
// If the affected file is a TTC shim, add the shim's original source file.
|
|
357
|
+
// This ensures that changes that affect TTC are typechecked even when the changes
|
|
358
|
+
// are otherwise unrelated from a TS perspective and do not result in Ivy codegen changes.
|
|
359
|
+
// For example, changing @Input property types of a directive used in another component's
|
|
360
|
+
// template.
|
|
361
|
+
if (ignoreForDiagnostics.has(sourceFile) &&
|
|
362
|
+
sourceFile.fileName.endsWith('.ngtypecheck.ts')) {
|
|
363
|
+
// This file name conversion relies on internal compiler logic and should be converted
|
|
364
|
+
// to an official method when available. 15 is length of `.ngtypecheck.ts`
|
|
365
|
+
const originalFilename = sourceFile.fileName.slice(0, -15) + '.ts';
|
|
366
|
+
const originalSourceFile = builder.getSourceFile(originalFilename);
|
|
367
|
+
if (originalSourceFile) {
|
|
368
|
+
affectedFiles.add(originalSourceFile);
|
|
369
|
+
}
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
return false;
|
|
373
|
+
});
|
|
374
|
+
if (!result) {
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
affectedFiles.add(result.affected);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
// Collect program level diagnostics
|
|
381
|
+
const diagnostics = [
|
|
382
|
+
...angularCompiler.getOptionDiagnostics(),
|
|
383
|
+
...builder.getOptionsDiagnostics(),
|
|
384
|
+
...builder.getGlobalDiagnostics(),
|
|
385
|
+
];
|
|
386
|
+
diagnosticsReporter(diagnostics);
|
|
387
|
+
// Collect source file specific diagnostics
|
|
388
|
+
for (const sourceFile of builder.getSourceFiles()) {
|
|
389
|
+
if (!ignoreForDiagnostics.has(sourceFile)) {
|
|
390
|
+
diagnosticsReporter(builder.getSyntacticDiagnostics(sourceFile));
|
|
391
|
+
diagnosticsReporter(builder.getSemanticDiagnostics(sourceFile));
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
const transformers = (0, transformation_1.createAotTransformers)(builder, this.pluginOptions, exports.imageDomains);
|
|
395
|
+
const getDependencies = (sourceFile) => {
|
|
396
|
+
const dependencies = [];
|
|
397
|
+
for (const resourcePath of angularCompiler.getResourceDependencies(sourceFile)) {
|
|
398
|
+
dependencies.push(resourcePath,
|
|
399
|
+
// Retrieve all dependencies of the resource (stylesheet imports, etc.)
|
|
400
|
+
...resourceLoader.getResourceDependencies(resourcePath));
|
|
401
|
+
}
|
|
402
|
+
return dependencies;
|
|
403
|
+
};
|
|
404
|
+
// Required to support asynchronous resource loading
|
|
405
|
+
// Must be done before creating transformers or getting template diagnostics
|
|
406
|
+
const pendingAnalysis = angularCompiler
|
|
407
|
+
.analyzeAsync()
|
|
408
|
+
.then(() => {
|
|
409
|
+
this.requiredFilesToEmit.clear();
|
|
410
|
+
for (const sourceFile of builder.getSourceFiles()) {
|
|
411
|
+
if (sourceFile.isDeclarationFile) {
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
// Collect sources that are required to be emitted
|
|
415
|
+
if (!ignoreForEmit.has(sourceFile) &&
|
|
416
|
+
!angularCompiler.incrementalCompilation.safeToSkipEmit(sourceFile)) {
|
|
417
|
+
this.requiredFilesToEmit.add((0, paths_1.normalizePath)(sourceFile.fileName));
|
|
418
|
+
// If required to emit, diagnostics may have also changed
|
|
419
|
+
if (!ignoreForDiagnostics.has(sourceFile)) {
|
|
420
|
+
affectedFiles.add(sourceFile);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
else if (this.sourceFileCache &&
|
|
424
|
+
!affectedFiles.has(sourceFile) &&
|
|
425
|
+
!ignoreForDiagnostics.has(sourceFile)) {
|
|
426
|
+
// Use cached Angular diagnostics for unchanged and unaffected files
|
|
427
|
+
const angularDiagnostics = this.sourceFileCache.getAngularDiagnostics(sourceFile);
|
|
428
|
+
if (angularDiagnostics) {
|
|
429
|
+
diagnosticsReporter(angularDiagnostics);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
// Collect new Angular diagnostics for files affected by changes
|
|
434
|
+
const OptimizeFor = this.compilerCli.OptimizeFor;
|
|
435
|
+
const optimizeDiagnosticsFor = affectedFiles.size <= DIAGNOSTICS_AFFECTED_THRESHOLD
|
|
436
|
+
? OptimizeFor.SingleFile
|
|
437
|
+
: OptimizeFor.WholeProgram;
|
|
438
|
+
for (const affectedFile of affectedFiles) {
|
|
439
|
+
const angularDiagnostics = angularCompiler.getDiagnosticsForFile(affectedFile, optimizeDiagnosticsFor);
|
|
440
|
+
diagnosticsReporter(angularDiagnostics);
|
|
441
|
+
this.sourceFileCache?.updateAngularDiagnostics(affectedFile, angularDiagnostics);
|
|
442
|
+
}
|
|
443
|
+
return {
|
|
444
|
+
emitter: this.createFileEmitter(builder, (0, transformation_1.mergeTransformers)(angularCompiler.prepareEmit().transformers, transformers), getDependencies, (sourceFile) => {
|
|
445
|
+
this.requiredFilesToEmit.delete((0, paths_1.normalizePath)(sourceFile.fileName));
|
|
446
|
+
angularCompiler.incrementalCompilation.recordSuccessfulEmit(sourceFile);
|
|
447
|
+
}),
|
|
448
|
+
};
|
|
449
|
+
})
|
|
450
|
+
.catch((err) => ({ errorMessage: err instanceof Error ? err.message : `${err}` }));
|
|
451
|
+
const analyzingFileEmitter = async (file) => {
|
|
452
|
+
const analysis = await pendingAnalysis;
|
|
453
|
+
if ('errorMessage' in analysis) {
|
|
454
|
+
throw new Error(analysis.errorMessage);
|
|
455
|
+
}
|
|
456
|
+
return analysis.emitter(file);
|
|
457
|
+
};
|
|
458
|
+
return {
|
|
459
|
+
fileEmitter: analyzingFileEmitter,
|
|
460
|
+
builder,
|
|
461
|
+
internalFiles: ignoreForEmit,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
updateJitProgram(compilerOptions, rootNames, host, diagnosticsReporter) {
|
|
465
|
+
let builder;
|
|
466
|
+
if (this.watchMode) {
|
|
467
|
+
builder = this.builder = ts.createEmitAndSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, this.builder);
|
|
468
|
+
}
|
|
469
|
+
else {
|
|
470
|
+
// When not in watch mode, the startup cost of the incremental analysis can be avoided by
|
|
471
|
+
// using an abstract builder that only wraps a TypeScript program.
|
|
472
|
+
builder = ts.createAbstractBuilder(rootNames, compilerOptions, host);
|
|
473
|
+
}
|
|
474
|
+
const diagnostics = [
|
|
475
|
+
...builder.getOptionsDiagnostics(),
|
|
476
|
+
...builder.getGlobalDiagnostics(),
|
|
477
|
+
...builder.getSyntacticDiagnostics(),
|
|
478
|
+
// Gather incremental semantic diagnostics
|
|
479
|
+
...builder.getSemanticDiagnostics(),
|
|
480
|
+
];
|
|
481
|
+
diagnosticsReporter(diagnostics);
|
|
482
|
+
const transformers = (0, transformation_1.createJitTransformers)(builder, this.compilerCliTooling, this.pluginOptions);
|
|
483
|
+
return {
|
|
484
|
+
fileEmitter: this.createFileEmitter(builder, transformers, () => []),
|
|
485
|
+
builder,
|
|
486
|
+
internalFiles: undefined,
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
createFileEmitter(program, transformers = {}, getExtraDependencies, onAfterEmit) {
|
|
490
|
+
return async (file) => {
|
|
491
|
+
const filePath = (0, paths_1.normalizePath)(file);
|
|
492
|
+
if (this.requiredFilesToEmitCache.has(filePath)) {
|
|
493
|
+
return this.requiredFilesToEmitCache.get(filePath);
|
|
494
|
+
}
|
|
495
|
+
const sourceFile = program.getSourceFile(filePath);
|
|
496
|
+
if (!sourceFile) {
|
|
497
|
+
return undefined;
|
|
498
|
+
}
|
|
499
|
+
let content;
|
|
500
|
+
let map;
|
|
501
|
+
program.emit(sourceFile, (filename, data) => {
|
|
502
|
+
if (filename.endsWith('.map')) {
|
|
503
|
+
map = data;
|
|
504
|
+
}
|
|
505
|
+
else if (filename.endsWith('.js')) {
|
|
506
|
+
content = data;
|
|
507
|
+
}
|
|
508
|
+
}, undefined, undefined, transformers);
|
|
509
|
+
onAfterEmit?.(sourceFile);
|
|
510
|
+
// Capture emit history info for Angular rebuild analysis
|
|
511
|
+
const hash = content ? (await this.addFileEmitHistory(filePath, content)).hash : undefined;
|
|
512
|
+
const dependencies = [
|
|
513
|
+
...(this.fileDependencies.get(filePath) || []),
|
|
514
|
+
...getExtraDependencies(sourceFile),
|
|
515
|
+
].map(paths_1.externalizePath);
|
|
516
|
+
return { content, map, dependencies, hash };
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
async initializeCompilerCli() {
|
|
520
|
+
// This uses a dynamic import to load `@angular/compiler-cli` which may be ESM.
|
|
521
|
+
// CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
|
|
522
|
+
// will currently, unconditionally downlevel dynamic import into a require call.
|
|
523
|
+
// require calls cannot load ESM code and will result in a runtime error. To workaround
|
|
524
|
+
// this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
|
|
525
|
+
// Once TypeScript provides support for keeping the dynamic import this workaround can
|
|
526
|
+
// be dropped.
|
|
527
|
+
this.compilerCliModule ??= await new Function(`return import('@angular/compiler-cli');`)();
|
|
528
|
+
this.compilerCliToolingModule ??= await new Function(`return import('@angular/compiler-cli/private/tooling');`)();
|
|
529
|
+
}
|
|
530
|
+
async addFileEmitHistory(filePath, content) {
|
|
531
|
+
node_assert_1.strict.ok(this.webpackCreateHash, 'File emitter is used prior to Webpack compilation');
|
|
532
|
+
const historyData = {
|
|
533
|
+
length: content.length,
|
|
534
|
+
hash: this.webpackCreateHash('xxhash64').update(content).digest(),
|
|
535
|
+
};
|
|
536
|
+
if (this.webpackCache) {
|
|
537
|
+
const history = await this.getFileEmitHistory(filePath);
|
|
538
|
+
if (!history || Buffer.compare(history.hash, historyData.hash) !== 0) {
|
|
539
|
+
// Hash doesn't match or item doesn't exist.
|
|
540
|
+
await this.webpackCache.storePromise(filePath, null, historyData);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
else if (this.watchMode) {
|
|
544
|
+
// The in memory file emit history is only required during watch mode.
|
|
545
|
+
this.fileEmitHistory.set(filePath, historyData);
|
|
546
|
+
}
|
|
547
|
+
return historyData;
|
|
548
|
+
}
|
|
549
|
+
async getFileEmitHistory(filePath) {
|
|
550
|
+
return this.webpackCache
|
|
551
|
+
? this.webpackCache.getPromise(filePath, null)
|
|
552
|
+
: this.fileEmitHistory.get(filePath);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
exports.AngularWebpackPlugin = AngularWebpackPlugin;
|
|
556
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["plugin.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,6CAA+C;AAC/C,+CAAiC;AAEjC,kDAAwD;AACxD,wDAA2D;AAC3D,mCAA0C;AAC1C,+CAKuB;AACvB,iCAOgB;AAChB,mCAAyD;AACzD,qCAAmG;AACnG,qCAAoE;AACpE,qDAAmG;AAEnG;;;;GAIG;AACH,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAE5B,QAAA,YAAY,GAAgB,IAAI,GAAG,EAAE,CAAC;AAwBnD,MAAM,WAAW,GAAG,kBAAkB,CAAC;AACvC,MAAM,uBAAuB,GAAG,IAAI,OAAO,EAAsC,CAAC;AAOlF,MAAa,oBAAoB;IACd,aAAa,CAA8B;IACpD,iBAAiB,CAA0C;IAC3D,wBAAwB,CAA0D;IAClF,SAAS,CAAW;IACpB,gBAAgB,CAAgB;IAChC,OAAO,CAA+C;IACtD,eAAe,CAAmB;IAClC,YAAY,CAAuC;IACnD,iBAAiB,CAA6C;IACrD,gBAAgB,GAAG,IAAI,GAAG,EAAuB,CAAC;IAClD,mBAAmB,GAAG,IAAI,GAAG,EAAU,CAAC;IACxC,wBAAwB,GAAG,IAAI,GAAG,E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IAAI,CAAC;YAC/E,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF;AA1qBD,oDA0qBC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
export declare const AngularPluginSymbol: unique symbol;
|
|
9
|
+
export interface EmitFileResult {
|
|
10
|
+
content?: string;
|
|
11
|
+
map?: string;
|
|
12
|
+
dependencies: readonly string[];
|
|
13
|
+
hash?: Uint8Array;
|
|
14
|
+
}
|
|
15
|
+
export type FileEmitter = (file: string) => Promise<EmitFileResult | undefined>;
|
|
16
|
+
export declare class FileEmitterRegistration {
|
|
17
|
+
#private;
|
|
18
|
+
update(emitter: FileEmitter): void;
|
|
19
|
+
emit(file: string): Promise<EmitFileResult | undefined>;
|
|
20
|
+
}
|
|
21
|
+
export declare class FileEmitterCollection {
|
|
22
|
+
#private;
|
|
23
|
+
register(): FileEmitterRegistration;
|
|
24
|
+
emit(file: string): Promise<EmitFileResult | undefined>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.FileEmitterCollection = exports.FileEmitterRegistration = exports.AngularPluginSymbol = void 0;
|
|
11
|
+
exports.AngularPluginSymbol = Symbol.for('@ngtools/webpack[angular-compiler]');
|
|
12
|
+
class FileEmitterRegistration {
|
|
13
|
+
#fileEmitter;
|
|
14
|
+
update(emitter) {
|
|
15
|
+
this.#fileEmitter = emitter;
|
|
16
|
+
}
|
|
17
|
+
emit(file) {
|
|
18
|
+
if (!this.#fileEmitter) {
|
|
19
|
+
throw new Error('Emit attempted before Angular Webpack plugin initialization.');
|
|
20
|
+
}
|
|
21
|
+
return this.#fileEmitter(file);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.FileEmitterRegistration = FileEmitterRegistration;
|
|
25
|
+
class FileEmitterCollection {
|
|
26
|
+
#registrations = [];
|
|
27
|
+
register() {
|
|
28
|
+
const registration = new FileEmitterRegistration();
|
|
29
|
+
this.#registrations.push(registration);
|
|
30
|
+
return registration;
|
|
31
|
+
}
|
|
32
|
+
async emit(file) {
|
|
33
|
+
if (this.#registrations.length === 1) {
|
|
34
|
+
return this.#registrations[0].emit(file);
|
|
35
|
+
}
|
|
36
|
+
for (const registration of this.#registrations) {
|
|
37
|
+
const result = await registration.emit(file);
|
|
38
|
+
if (result) {
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.FileEmitterCollection = FileEmitterCollection;
|
|
45
|
+
//# sourceMappingURL=symbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol.js","sourceRoot":"","sources":["symbol.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEU,QAAA,mBAAmB,GAAkB,MAAM,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;AAWnG,MAAa,uBAAuB;IAClC,YAAY,CAAe;IAE3B,MAAM,CAAC,OAAoB;QACzB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;IAC9B,CAAC;IAED,IAAI,CAAC,IAAY;QACf,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;QAClF,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACF;AAdD,0DAcC;AAED,MAAa,qBAAqB;IAChC,cAAc,GAA8B,EAAE,CAAC;IAE/C,QAAQ;QACN,MAAM,YAAY,GAAG,IAAI,uBAAuB,EAAE,CAAC;QACnD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEvC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAAY;QACrB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;QAED,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7C,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAtBD,sDAsBC"}
|