Update to angular 20

This commit is contained in:
2026-08-05 08:20:06 +02:00
parent 5e44c88cd3
commit 2dbeffc262
4 changed files with 1909 additions and 3883 deletions
+28
View File
@@ -0,0 +1,28 @@
import { transformAsync } from '@babel/core';
import linkerPlugin from '@angular/compiler-cli/linker/babel';
import { needsLinking } from '@angular/compiler-cli/linker';
export default function angularLinkerLoader(content, map) {
const callback = this.async();
(async () => {
try {
const filename = this.resourcePath;
if (!needsLinking(filename, content)) {
callback(null, content, map);
return;
}
// Create a fresh plugin instance per file. The linker plugin is stateful
// and cannot be shared across concurrent transforms.
const { code, map: resultMap } = await transformAsync(content, {
filename,
sourceFileName: filename,
sourceMaps: !!this.sourceMap,
compact: false,
plugins: [api => linkerPlugin(api, { sourceMapping: false })],
});
callback(null, code, resultMap || undefined);
} catch (err) {
callback(err);
}
})();
}