@nx/angular-rspack-compiler 20.9.0 → 21.0.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/dist/compilation/build-and-analyze.d.ts +2 -2
- package/dist/compilation/build-and-analyze.d.ts.map +1 -1
- package/dist/compilation/build-and-analyze.js +3 -3
- package/dist/compilation/index.d.ts +1 -1
- package/dist/compilation/index.d.ts.map +1 -1
- package/dist/compilation/index.js +1 -1
- package/dist/compilation/setup-compilation.d.ts +4 -3
- package/dist/compilation/setup-compilation.d.ts.map +1 -1
- package/dist/compilation/setup-compilation.js +7 -13
- package/dist/compilation/setup-with-angular-compilation.d.ts +5 -0
- package/dist/compilation/setup-with-angular-compilation.d.ts.map +1 -0
- package/dist/compilation/setup-with-angular-compilation.js +34 -0
- package/dist/models/index.d.ts +5 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +9 -1
- package/dist/utils/source-file-cache.d.ts +2 -2
- package/dist/utils/source-file-cache.d.ts.map +1 -1
- package/package.json +1 -1
- package/patch/patch-angular-build.js +7 -0
- package/dist/compilation/setup-with-paralell-compilation.d.ts +0 -5
- package/dist/compilation/setup-with-paralell-compilation.d.ts.map +0 -1
- package/dist/compilation/setup-with-paralell-compilation.js +0 -28
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ParallelCompilation } from '@angular/build/src/tools/angular/compilation/parallel-compilation';
|
|
2
1
|
import { JavaScriptTransformer } from '@angular/build/src/tools/esbuild/javascript-transformer';
|
|
3
|
-
|
|
2
|
+
import { AngularCompilation } from '../models';
|
|
3
|
+
export declare function buildAndAnalyze(angularCompilation: AngularCompilation, typescriptFileCache: Map<string, string | Uint8Array>, javascriptTransformer: JavaScriptTransformer): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=build-and-analyze.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-and-analyze.d.ts","sourceRoot":"","sources":["../../src/compilation/build-and-analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"build-and-analyze.d.ts","sourceRoot":"","sources":["../../src/compilation/build-and-analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAEhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,wBAAsB,eAAe,CACnC,kBAAkB,EAAE,kBAAkB,EACtC,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,EACrD,qBAAqB,EAAE,qBAAqB,iBAgB7C"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildAndAnalyze = buildAndAnalyze;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
-
async function
|
|
6
|
-
for (const { filename, contents, } of await
|
|
5
|
+
async function buildAndAnalyze(angularCompilation, typescriptFileCache, javascriptTransformer) {
|
|
6
|
+
for (const { filename, contents, } of await angularCompilation.emitAffectedFiles()) {
|
|
7
7
|
const normalizedFilename = (0, path_1.normalize)(filename.replace(/^[A-Z]:/, ''));
|
|
8
8
|
await javascriptTransformer
|
|
9
9
|
.transformData(normalizedFilename, contents, true, false)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compilation/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compilation/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC"}
|
|
@@ -4,4 +4,4 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./augments"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./build-and-analyze"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./setup-compilation"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./setup-with-
|
|
7
|
+
tslib_1.__exportStar(require("./setup-with-angular-compilation"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RsbuildConfig } from '@rsbuild/core';
|
|
2
2
|
import * as ts from 'typescript';
|
|
3
|
-
import { InlineStyleLanguage, FileReplacement } from '../models';
|
|
3
|
+
import { InlineStyleLanguage, FileReplacement, type Sass } from '../models';
|
|
4
4
|
import { ComponentStylesheetBundler } from '@angular/build/src/tools/esbuild/angular/component-stylesheets';
|
|
5
5
|
export interface SetupCompilationOptions {
|
|
6
6
|
root: string;
|
|
@@ -10,13 +10,14 @@ export interface SetupCompilationOptions {
|
|
|
10
10
|
fileReplacements: Array<FileReplacement>;
|
|
11
11
|
useTsProjectReferences?: boolean;
|
|
12
12
|
hasServer?: boolean;
|
|
13
|
+
includePaths?: string[];
|
|
14
|
+
sass?: Sass;
|
|
13
15
|
}
|
|
14
16
|
export declare const DEFAULT_NG_COMPILER_OPTIONS: ts.CompilerOptions;
|
|
15
17
|
export declare function setupCompilation(config: Pick<RsbuildConfig, 'mode' | 'source'>, options: SetupCompilationOptions): Promise<{
|
|
16
18
|
rootNames: string[];
|
|
17
19
|
compilerOptions: import("@angular/compiler-cli").AngularCompilerOptions;
|
|
18
|
-
host: ts.CompilerHost;
|
|
19
20
|
componentStylesheetBundler: ComponentStylesheetBundler;
|
|
20
21
|
}>;
|
|
21
|
-
export declare function styleTransform(componentStylesheetBundler: ComponentStylesheetBundler): (styles: string, containingFile: string, stylesheetFile?: string) => Promise<
|
|
22
|
+
export declare function styleTransform(componentStylesheetBundler: ComponentStylesheetBundler): (styles: string, containingFile: string, stylesheetFile?: string) => Promise<string>;
|
|
22
23
|
//# 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;
|
|
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,EAE3B,MAAM,gEAAgE,CAAC;AAIxE,MAAM,WAAW,uBAAuB;IACtC,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;AAEF,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,QAAQ,CAAC,EAC9C,OAAO,EAAE,uBAAuB;;;;GAiDjC;AAED,wBAAgB,cAAc,CAC5B,0BAA0B,EAAE,0BAA0B,YAG5C,MAAM,kBACE,MAAM,mBACL,MAAM,qBAgC1B"}
|
|
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DEFAULT_NG_COMPILER_OPTIONS = void 0;
|
|
4
4
|
exports.setupCompilation = setupCompilation;
|
|
5
5
|
exports.styleTransform = styleTransform;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
const ts = tslib_1.__importStar(require("typescript"));
|
|
8
|
-
const sass_embedded_1 = require("sass-embedded");
|
|
9
|
-
const augments_1 = require("./augments");
|
|
10
6
|
const utils_1 = require("../utils");
|
|
11
7
|
const component_stylesheets_1 = require("@angular/build/src/tools/esbuild/angular/component-stylesheets");
|
|
12
8
|
const targets_from_browsers_1 = require("../utils/targets-from-browsers");
|
|
@@ -27,7 +23,6 @@ exports.DEFAULT_NG_COMPILER_OPTIONS = {
|
|
|
27
23
|
supportJitMode: false,
|
|
28
24
|
};
|
|
29
25
|
async function setupCompilation(config, options) {
|
|
30
|
-
const isProd = config.mode === 'production';
|
|
31
26
|
const { readConfiguration } = await (0, utils_1.loadCompilerCli)();
|
|
32
27
|
const { options: tsCompilerOptions, rootNames } = readConfiguration(config.source?.tsconfigPath ?? options.tsConfig, {
|
|
33
28
|
...exports.DEFAULT_NG_COMPILER_OPTIONS,
|
|
@@ -40,7 +35,6 @@ async function setupCompilation(config, options) {
|
|
|
40
35
|
: {}),
|
|
41
36
|
});
|
|
42
37
|
const compilerOptions = tsCompilerOptions;
|
|
43
|
-
const host = ts.createIncrementalCompilerHost(compilerOptions);
|
|
44
38
|
const componentStylesheetBundler = new component_stylesheets_1.ComponentStylesheetBundler({
|
|
45
39
|
workspaceRoot: options.root,
|
|
46
40
|
optimization: config.mode === 'production',
|
|
@@ -54,17 +48,12 @@ async function setupCompilation(config, options) {
|
|
|
54
48
|
target: (0, targets_from_browsers_1.transformSupportedBrowsersToTargets)((0, private_1.getSupportedBrowsers)(options.root, {
|
|
55
49
|
warn: (message) => console.warn(message),
|
|
56
50
|
})),
|
|
51
|
+
includePaths: options.includePaths,
|
|
52
|
+
sass: options.sass,
|
|
57
53
|
}, options.inlineStyleLanguage, false);
|
|
58
|
-
if (options.aot) {
|
|
59
|
-
(0, augments_1.augmentHostWithResources)(host, (code) => (0, sass_embedded_1.compileString)(code).css, {
|
|
60
|
-
inlineStylesExtension: options.inlineStyleLanguage,
|
|
61
|
-
isProd,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
54
|
return {
|
|
65
55
|
rootNames,
|
|
66
56
|
compilerOptions,
|
|
67
|
-
host,
|
|
68
57
|
componentStylesheetBundler,
|
|
69
58
|
};
|
|
70
59
|
}
|
|
@@ -78,6 +67,11 @@ function styleTransform(componentStylesheetBundler) {
|
|
|
78
67
|
else {
|
|
79
68
|
stylesheetResult = await componentStylesheetBundler.bundleInline(styles, containingFile, containingFile.endsWith('.html') ? 'css' : undefined);
|
|
80
69
|
}
|
|
70
|
+
if (stylesheetResult.errors && stylesheetResult.errors.length > 0) {
|
|
71
|
+
for (const error of stylesheetResult.errors) {
|
|
72
|
+
console.error('Failed to compile styles. Continuing execution ignoring failing stylesheet...', error.text);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
81
75
|
return stylesheetResult.contents;
|
|
82
76
|
}
|
|
83
77
|
catch (e) {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RsbuildConfig } from '@rsbuild/core';
|
|
2
|
+
import { AngularCompilation, SourceFileCache } from '../models';
|
|
3
|
+
import { SetupCompilationOptions } from './setup-compilation';
|
|
4
|
+
export declare function setupCompilationWithAngularCompilation(config: Pick<RsbuildConfig, 'source'>, options: SetupCompilationOptions, sourceFileCache?: SourceFileCache, angularCompilation?: AngularCompilation, modifiedFiles?: Set<string>): Promise<AngularCompilation>;
|
|
5
|
+
//# sourceMappingURL=setup-with-angular-compilation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-with-angular-compilation.d.ts","sourceRoot":"","sources":["../../src/compilation/setup-with-angular-compilation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAGL,kBAAkB,EAClB,eAAe,EAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EAGL,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,wBAAsB,sCAAsC,CAC1D,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,EACrC,OAAO,EAAE,uBAAuB,EAChC,eAAe,CAAC,EAAE,eAAe,EACjC,kBAAkB,CAAC,EAAE,kBAAkB,EACvC,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,+BAoC5B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupCompilationWithAngularCompilation = setupCompilationWithAngularCompilation;
|
|
4
|
+
const models_1 = require("../models");
|
|
5
|
+
const setup_compilation_1 = require("./setup-compilation");
|
|
6
|
+
async function setupCompilationWithAngularCompilation(config, options, sourceFileCache, angularCompilation, modifiedFiles) {
|
|
7
|
+
const { rootNames, compilerOptions, componentStylesheetBundler } = await (0, setup_compilation_1.setupCompilation)(config, options);
|
|
8
|
+
angularCompilation ?? (angularCompilation = options.aot
|
|
9
|
+
? new models_1.AotCompilation(options.hasServer === false)
|
|
10
|
+
: new models_1.JitCompilation(options.hasServer === false));
|
|
11
|
+
modifiedFiles ?? (modifiedFiles = new Set(rootNames));
|
|
12
|
+
const fileReplacements = options.fileReplacements.reduce((r, f) => {
|
|
13
|
+
r[f.replace] = f.with;
|
|
14
|
+
return r;
|
|
15
|
+
}, {});
|
|
16
|
+
try {
|
|
17
|
+
const { referencedFiles } = await angularCompilation.initialize(config.source?.tsconfigPath ?? options.tsConfig, {
|
|
18
|
+
sourceFileCache,
|
|
19
|
+
fileReplacements,
|
|
20
|
+
modifiedFiles,
|
|
21
|
+
transformStylesheet: (0, setup_compilation_1.styleTransform)(componentStylesheetBundler),
|
|
22
|
+
processWebWorker(workerFile) {
|
|
23
|
+
return workerFile;
|
|
24
|
+
},
|
|
25
|
+
}, () => compilerOptions);
|
|
26
|
+
if (sourceFileCache) {
|
|
27
|
+
sourceFileCache.referencedFiles = referencedFiles;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
console.error('Failed to initialize Angular Compilation', e);
|
|
32
|
+
}
|
|
33
|
+
return angularCompilation;
|
|
34
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { JavaScriptTransformer } from '@angular/build/src/tools/esbuild/javascript-transformer';
|
|
2
2
|
import { ParallelCompilation } from '@angular/build/src/tools/angular/compilation/parallel-compilation';
|
|
3
|
-
|
|
3
|
+
import { AotCompilation } from '@angular/build/src/tools/angular/compilation/aot-compilation';
|
|
4
|
+
import { JitCompilation } from '@angular/build/src/tools/angular/compilation/jit-compilation';
|
|
5
|
+
import { AngularCompilation } from '@angular/build/src/tools/angular/compilation/angular-compilation';
|
|
6
|
+
import { SourceFileCache } from '@angular/build/private';
|
|
7
|
+
export { ParallelCompilation, JavaScriptTransformer, SourceFileCache, AotCompilation, JitCompilation, AngularCompilation, };
|
|
4
8
|
export * from './inline-style-language';
|
|
5
9
|
export * from './file-replacement';
|
|
6
10
|
export * from './style-preprocessor-options';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,mEAAmE,CAAC;AACxG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,mEAAmE,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,kEAAkE,CAAC;AACtG,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,CAAC;AAEF,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAE7C,oBAAY,eAAe;IACzB,IAAI,IAAI;IACR,MAAM,IAAS;IACf,SAAS,IAAS;IAClB,QAAQ,IAAS;IACjB,GAAG,IAAgC;CACpC;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IACpC,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB"}
|
package/dist/models/index.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DiagnosticModes = exports.JavaScriptTransformer = exports.ParallelCompilation = void 0;
|
|
3
|
+
exports.DiagnosticModes = exports.AngularCompilation = exports.JitCompilation = exports.AotCompilation = exports.SourceFileCache = exports.JavaScriptTransformer = exports.ParallelCompilation = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const javascript_transformer_1 = require("@angular/build/src/tools/esbuild/javascript-transformer");
|
|
6
6
|
Object.defineProperty(exports, "JavaScriptTransformer", { enumerable: true, get: function () { return javascript_transformer_1.JavaScriptTransformer; } });
|
|
7
7
|
const parallel_compilation_1 = require("@angular/build/src/tools/angular/compilation/parallel-compilation");
|
|
8
8
|
Object.defineProperty(exports, "ParallelCompilation", { enumerable: true, get: function () { return parallel_compilation_1.ParallelCompilation; } });
|
|
9
|
+
const aot_compilation_1 = require("@angular/build/src/tools/angular/compilation/aot-compilation");
|
|
10
|
+
Object.defineProperty(exports, "AotCompilation", { enumerable: true, get: function () { return aot_compilation_1.AotCompilation; } });
|
|
11
|
+
const jit_compilation_1 = require("@angular/build/src/tools/angular/compilation/jit-compilation");
|
|
12
|
+
Object.defineProperty(exports, "JitCompilation", { enumerable: true, get: function () { return jit_compilation_1.JitCompilation; } });
|
|
13
|
+
const angular_compilation_1 = require("@angular/build/src/tools/angular/compilation/angular-compilation");
|
|
14
|
+
Object.defineProperty(exports, "AngularCompilation", { enumerable: true, get: function () { return angular_compilation_1.AngularCompilation; } });
|
|
15
|
+
const private_1 = require("@angular/build/private");
|
|
16
|
+
Object.defineProperty(exports, "SourceFileCache", { enumerable: true, get: function () { return private_1.SourceFileCache; } });
|
|
9
17
|
tslib_1.__exportStar(require("./inline-style-language"), exports);
|
|
10
18
|
tslib_1.__exportStar(require("./file-replacement"), exports);
|
|
11
19
|
tslib_1.__exportStar(require("./style-preprocessor-options"), exports);
|
|
@@ -9,8 +9,8 @@ import type ts from 'typescript';
|
|
|
9
9
|
export declare class SourceFileCache extends Map<string, ts.SourceFile> {
|
|
10
10
|
readonly persistentCachePath?: string | undefined;
|
|
11
11
|
readonly modifiedFiles: Set<string>;
|
|
12
|
-
readonly babelFileCache: Map<string, Uint8Array
|
|
13
|
-
readonly typeScriptFileCache: Map<string, string | Uint8Array
|
|
12
|
+
readonly babelFileCache: Map<string, Uint8Array<ArrayBufferLike>>;
|
|
13
|
+
readonly typeScriptFileCache: Map<string, string | Uint8Array<ArrayBufferLike>>;
|
|
14
14
|
referencedFiles?: readonly string[];
|
|
15
15
|
constructor(persistentCachePath?: string | undefined);
|
|
16
16
|
invalidate(files: Iterable<string>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-file-cache.d.ts","sourceRoot":"","sources":["../../src/utils/source-file-cache.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAKjC,qBAAa,eAAgB,SAAQ,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC;IAOjD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM;IANjD,QAAQ,CAAC,aAAa,cAAqB;IAC3C,QAAQ,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"source-file-cache.d.ts","sourceRoot":"","sources":["../../src/utils/source-file-cache.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAKjC,qBAAa,eAAgB,SAAQ,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC;IAOjD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM;IANjD,QAAQ,CAAC,aAAa,cAAqB;IAC3C,QAAQ,CAAC,cAAc,2CAAiC;IACxD,QAAQ,CAAC,mBAAmB,oDAA0C;IAEtE,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;gBAEf,mBAAmB,CAAC,EAAE,MAAM,YAAA;IAIjD,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI;CAiB1C"}
|
package/package.json
CHANGED
|
@@ -15,6 +15,13 @@ function main() {
|
|
|
15
15
|
fileContentsJson.exports[
|
|
16
16
|
'./src/tools/angular/compilation/parallel-compilation'
|
|
17
17
|
] = './src/tools/angular/compilation/parallel-compilation.js';
|
|
18
|
+
fileContentsJson.exports[
|
|
19
|
+
'./src/tools/angular/compilation/angular-compilation'
|
|
20
|
+
] = './src/tools/angular/compilation/angular-compilation.js';
|
|
21
|
+
fileContentsJson.exports['./src/tools/angular/compilation/jit-compilation'] =
|
|
22
|
+
'./src/tools/angular/compilation/jit-compilation.js';
|
|
23
|
+
fileContentsJson.exports['./src/tools/angular/compilation/aot-compilation'] =
|
|
24
|
+
'./src/tools/angular/compilation/aot-compilation.js';
|
|
18
25
|
fileContentsJson.exports[
|
|
19
26
|
'./src/tools/esbuild/angular/component-stylesheets'
|
|
20
27
|
] = './src/tools/esbuild/angular/component-stylesheets.js';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { RsbuildConfig } from '@rsbuild/core';
|
|
2
|
-
import { ParallelCompilation } from '@angular/build/src/tools/angular/compilation/parallel-compilation';
|
|
3
|
-
import { SetupCompilationOptions } from './setup-compilation';
|
|
4
|
-
export declare function setupCompilationWithParallelCompilation(config: Pick<RsbuildConfig, 'source'>, options: SetupCompilationOptions): Promise<ParallelCompilation>;
|
|
5
|
-
//# sourceMappingURL=setup-with-paralell-compilation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-with-paralell-compilation.d.ts","sourceRoot":"","sources":["../../src/compilation/setup-with-paralell-compilation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mEAAmE,CAAC;AACxG,OAAO,EAGL,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,wBAAsB,uCAAuC,CAC3D,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,EACrC,OAAO,EAAE,uBAAuB,gCAgCjC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupCompilationWithParallelCompilation = setupCompilationWithParallelCompilation;
|
|
4
|
-
const parallel_compilation_1 = require("@angular/build/src/tools/angular/compilation/parallel-compilation");
|
|
5
|
-
const setup_compilation_1 = require("./setup-compilation");
|
|
6
|
-
async function setupCompilationWithParallelCompilation(config, options) {
|
|
7
|
-
const { rootNames, compilerOptions, componentStylesheetBundler } = await (0, setup_compilation_1.setupCompilation)(config, options);
|
|
8
|
-
const parallelCompilation = new parallel_compilation_1.ParallelCompilation(!options.aot, options.hasServer === false);
|
|
9
|
-
const fileReplacements = options.fileReplacements.reduce((r, f) => {
|
|
10
|
-
r[f.replace] = f.with;
|
|
11
|
-
return r;
|
|
12
|
-
}, {});
|
|
13
|
-
try {
|
|
14
|
-
await parallelCompilation.initialize(config.source?.tsconfigPath ?? options.tsConfig, {
|
|
15
|
-
...compilerOptions,
|
|
16
|
-
fileReplacements,
|
|
17
|
-
modifiedFiles: new Set(rootNames),
|
|
18
|
-
transformStylesheet: (0, setup_compilation_1.styleTransform)(componentStylesheetBundler),
|
|
19
|
-
processWebWorker(workerFile) {
|
|
20
|
-
return workerFile;
|
|
21
|
-
},
|
|
22
|
-
}, () => compilerOptions);
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
console.error('Failed to initialize Angular Compilation', e);
|
|
26
|
-
}
|
|
27
|
-
return parallelCompilation;
|
|
28
|
-
}
|