@nx/angular-rspack-compiler 22.7.7 → 22.7.9

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.
@@ -26,5 +26,17 @@ export declare function setupCompilation(config: Pick<RsbuildConfig, 'mode' | 's
26
26
  compilerOptions: import("@angular/compiler-cli").AngularCompilerOptions;
27
27
  componentStylesheetBundler: ComponentStylesheetBundler;
28
28
  }>;
29
+ /**
30
+ * Dispose the shared component stylesheet bundler and reset the singleton.
31
+ *
32
+ * `@angular/build` >= 21.2.14 backs `ComponentStylesheetBundler` with a
33
+ * persistent esbuild build context (it previously used a one-shot
34
+ * `esbuild.build()` for non-incremental bundling). That context keeps an
35
+ * esbuild service - a child process and its sockets - alive until disposed,
36
+ * which prevents a one-shot `rspack build` from exiting once the bundle is
37
+ * written. Angular's own application builder disposes it in a `finally` block;
38
+ * we must do the same since we drive the bundler directly.
39
+ */
40
+ export declare function disposeComponentStylesheetBundler(): Promise<void>;
29
41
  export declare function styleTransform(componentStylesheetBundler: ComponentStylesheetBundler): (styles: string, containingFile: string, stylesheetFile?: string) => Promise<StylesheetTransformResult>;
30
42
  //# sourceMappingURL=setup-compilation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-compilation.d.ts","sourceRoot":"","sources":["../../src/compilation/setup-compilation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAE5E,OAAO,EACL,0BAA0B,EAI3B,MAAM,wBAAwB,CAAC;AAKhC,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,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C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,gBAAgB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IACzC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC,eAc5C,CAAC;AAKF,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,QAAQ,CAAC,EAC9C,OAAO,EAAE,uBAAuB;;;;GAuEjC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iCAAiC,IAAI,OAAO,CAAC,IAAI,CAAC,CAMvE;AAED,wBAAgB,cAAc,CAC5B,0BAA0B,EAAE,0BAA0B,IAGpD,QAAQ,MAAM,EACd,gBAAgB,MAAM,EACtB,iBAAiB,MAAM,KACtB,OAAO,CAAC,yBAAyB,CAAC,CAmCtC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_NG_COMPILER_OPTIONS = void 0;
4
4
  exports.setupCompilation = setupCompilation;
5
+ exports.disposeComponentStylesheetBundler = disposeComponentStylesheetBundler;
5
6
  exports.styleTransform = styleTransform;
6
7
  const utils_1 = require("../utils");
7
8
  const private_1 = require("@angular/build/private");
@@ -80,6 +81,24 @@ async function setupCompilation(config, options) {
80
81
  componentStylesheetBundler: COMPONENT_STYLESHEET_BUNDLER,
81
82
  };
82
83
  }
84
+ /**
85
+ * Dispose the shared component stylesheet bundler and reset the singleton.
86
+ *
87
+ * `@angular/build` >= 21.2.14 backs `ComponentStylesheetBundler` with a
88
+ * persistent esbuild build context (it previously used a one-shot
89
+ * `esbuild.build()` for non-incremental bundling). That context keeps an
90
+ * esbuild service - a child process and its sockets - alive until disposed,
91
+ * which prevents a one-shot `rspack build` from exiting once the bundle is
92
+ * written. Angular's own application builder disposes it in a `finally` block;
93
+ * we must do the same since we drive the bundler directly.
94
+ */
95
+ async function disposeComponentStylesheetBundler() {
96
+ if (COMPONENT_STYLESHEET_BUNDLER) {
97
+ const bundler = COMPONENT_STYLESHEET_BUNDLER;
98
+ COMPONENT_STYLESHEET_BUNDLER = undefined;
99
+ await bundler.dispose();
100
+ }
101
+ }
83
102
  function styleTransform(componentStylesheetBundler) {
84
103
  return async (styles, containingFile, stylesheetFile) => {
85
104
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nx/angular-rspack-compiler",
3
3
  "private": false,
4
- "version": "22.7.7",
4
+ "version": "22.7.9",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },