@absolutejs/absolute 0.19.0-beta.735 → 0.19.0-beta.737
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/dist/build.js +78 -76
- package/dist/build.js.map +6 -6
- package/dist/index.js +78 -76
- package/dist/index.js.map +6 -6
- package/dist/src/build/angularLinkerPlugin.d.ts +21 -4
- package/dist/src/build/buildAngularVendor.d.ts +15 -2
- package/package.json +1 -1
|
@@ -2,10 +2,27 @@ import type { BunPlugin } from 'bun';
|
|
|
2
2
|
/**
|
|
3
3
|
* Bun bundler plugin that runs the Angular Linker on partially compiled
|
|
4
4
|
* Angular libraries at build time. Converts ɵɵngDeclare* declarations
|
|
5
|
-
* into fully
|
|
6
|
-
* the browser.
|
|
5
|
+
* into fully linked code.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* The `linkerJitMode` flag controls whether NgModule definitions retain
|
|
8
|
+
* `declarations`/`exports` (JIT-mode, required when consumer code is
|
|
9
|
+
* runtime-compiled) or strip them (AOT-mode, smaller output but only
|
|
10
|
+
* correct when consumer components have ɵcmp.dependencies baked in by
|
|
11
|
+
* the Angular compiler-cli).
|
|
12
|
+
*
|
|
13
|
+
* In AbsoluteJS dev/HMR, user components are TypeScript-transpiled via
|
|
14
|
+
* `compileAngularFileJIT` and rely on @angular/compiler at runtime —
|
|
15
|
+
* that runtime JIT path reads `NgModule.ɵmod.declarations` to find
|
|
16
|
+
* directives like FormGroupDirective. Linking vendor code in AOT mode
|
|
17
|
+
* (the default) silently breaks dev because declarations get stripped
|
|
18
|
+
* and runtime JIT then can't resolve `[formGroup]`, `[ngIf]`, etc. So
|
|
19
|
+
* dev/HMR builds must use `linkerJitMode: true`. Production AOT builds
|
|
20
|
+
* use `linkerJitMode: false` (matches AOT'd user components).
|
|
21
|
+
*
|
|
22
|
+
* Cache key includes mode so dev and prod artifacts don't collide.
|
|
10
23
|
*/
|
|
24
|
+
export declare const createAngularLinkerPlugin: (linkerJitMode: boolean) => BunPlugin;
|
|
25
|
+
/** Default AOT-mode plugin instance — keep for callers that don't need
|
|
26
|
+
* to choose. Production AOT builds and any callsite that AOT-compiles
|
|
27
|
+
* user components alongside vendor should use this. */
|
|
11
28
|
export declare const angularLinkerPlugin: BunPlugin;
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
/** Build vendor bundles for every @angular/* package the project imports.
|
|
2
|
-
|
|
1
|
+
/** Build vendor bundles for every @angular/* package the project imports.
|
|
2
|
+
* `linkerJitMode` controls whether NgModule definitions retain their
|
|
3
|
+
* declarations/exports — required when consumer (user) components are
|
|
4
|
+
* runtime-compiled by `@angular/compiler` (dev/HMR via compileAngularFileJIT).
|
|
5
|
+
* Production AOT builds set this to false to match AOT'd user components.
|
|
6
|
+
*
|
|
7
|
+
* `depVendorSpecifiers` are non-framework packages that are also vendored
|
|
8
|
+
* separately (by `buildDepVendor`). They MUST be externalized here too —
|
|
9
|
+
* otherwise transitive imports like `@angular/fire/compat/auth` →
|
|
10
|
+
* `firebase/compat/auth` get bundled twice, creating duplicate
|
|
11
|
+
* @firebase/app-compat instances. The angular-vendor copy registers
|
|
12
|
+
* `firebase.auth.*` on its own firebase singleton, leaving the user's
|
|
13
|
+
* `import firebase from 'firebase/compat/app'` with `firebase.auth` undefined.
|
|
14
|
+
* Externalizing forces both pipelines to share the same /vendor chunks. */
|
|
15
|
+
export declare const buildAngularVendor: (buildDir: string, directories?: string[], linkerJitMode?: boolean, depVendorSpecifiers?: string[]) => Promise<string[]>;
|
|
3
16
|
export declare const computeAngularVendorPaths: (specifiers?: string[]) => Record<string, string>;
|
|
4
17
|
/** Async variant that scans source + transitive deps before producing the
|
|
5
18
|
* vendor path map. Use this when the page-bundle build needs the full set of
|
package/package.json
CHANGED