@nx/angular-rspack 20.8.2 → 20.9.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/lib/config/config-utils/browser-config.d.ts +4 -0
- package/dist/lib/config/config-utils/browser-config.d.ts.map +1 -0
- package/dist/lib/config/config-utils/browser-config.js +68 -0
- package/dist/lib/config/config-utils/common-config.d.ts +3 -0
- package/dist/lib/config/config-utils/common-config.d.ts.map +1 -0
- package/dist/lib/config/config-utils/common-config.js +111 -0
- package/dist/lib/config/config-utils/dev-server-config-utils.d.ts +4 -0
- package/dist/lib/config/config-utils/dev-server-config-utils.d.ts.map +1 -0
- package/dist/lib/config/config-utils/dev-server-config-utils.js +255 -0
- package/dist/lib/config/{entry-points.d.ts → config-utils/entry-points.d.ts} +1 -1
- package/dist/lib/config/config-utils/entry-points.d.ts.map +1 -0
- package/dist/lib/config/config-utils/helpers.d.ts +13 -0
- package/dist/lib/config/config-utils/helpers.d.ts.map +1 -0
- package/dist/lib/config/{helpers.js → config-utils/helpers.js} +33 -0
- package/dist/lib/config/config-utils/optimization-config.d.ts +5 -0
- package/dist/lib/config/config-utils/optimization-config.d.ts.map +1 -0
- package/dist/lib/config/config-utils/optimization-config.js +67 -0
- package/dist/lib/config/config-utils/server-config.d.ts +4 -0
- package/dist/lib/config/config-utils/server-config.d.ts.map +1 -0
- package/dist/lib/config/config-utils/server-config.js +87 -0
- package/dist/lib/config/config-utils/sourcemap-utils.d.ts +7 -0
- package/dist/lib/config/config-utils/sourcemap-utils.d.ts.map +1 -0
- package/dist/lib/config/config-utils/sourcemap-utils.js +48 -0
- package/dist/lib/config/config-utils/style-config-utils.d.ts +7 -0
- package/dist/lib/config/config-utils/style-config-utils.d.ts.map +1 -0
- package/dist/lib/config/config-utils/style-config-utils.js +353 -0
- package/dist/lib/config/config-utils/user-defined-config-helpers.d.ts +78 -0
- package/dist/lib/config/config-utils/user-defined-config-helpers.d.ts.map +1 -0
- package/dist/lib/config/config-utils/user-defined-config-helpers.js +23 -0
- package/dist/lib/config/create-config.d.ts +2 -75
- package/dist/lib/config/create-config.d.ts.map +1 -1
- package/dist/lib/config/create-config.js +17 -473
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +9 -0
- package/dist/lib/models/angular-rspack-plugin-options.d.ts +41 -4
- package/dist/lib/models/angular-rspack-plugin-options.d.ts.map +1 -1
- package/dist/lib/models/normalize-options.d.ts.map +1 -1
- package/dist/lib/models/normalize-options.js +53 -54
- package/dist/lib/models/unsupported-options.d.ts +0 -7
- package/dist/lib/models/unsupported-options.d.ts.map +1 -1
- package/dist/lib/models/unsupported-options.js +0 -4
- package/dist/lib/plugins/angular-rspack-plugin.d.ts.map +1 -1
- package/dist/lib/plugins/angular-rspack-plugin.js +0 -7
- package/dist/lib/plugins/angular-ssr-dev-server.d.ts +2 -2
- package/dist/lib/plugins/angular-ssr-dev-server.d.ts.map +1 -1
- package/dist/lib/plugins/angular-ssr-dev-server.js +19 -9
- package/dist/lib/plugins/index-html-plugin.d.ts.map +1 -1
- package/dist/lib/plugins/index-html-plugin.js +2 -7
- package/dist/lib/plugins/loaders/platform-server-exports.loader.d.ts +5 -0
- package/dist/lib/plugins/loaders/platform-server-exports.loader.d.ts.map +1 -0
- package/dist/lib/plugins/loaders/platform-server-exports.loader.js +18 -0
- package/dist/lib/plugins/ng-rspack.d.ts.map +1 -1
- package/dist/lib/plugins/ng-rspack.js +3 -3
- package/dist/lib/plugins/prerender-plugin.d.ts +8 -0
- package/dist/lib/plugins/prerender-plugin.d.ts.map +1 -0
- package/dist/lib/plugins/prerender-plugin.js +154 -0
- package/dist/lib/plugins/tools/render-worker.d.ts +31 -0
- package/dist/lib/plugins/tools/render-worker.d.ts.map +1 -0
- package/dist/lib/plugins/tools/render-worker.js +103 -0
- package/dist/lib/plugins/tools/routes-extractor-worker.d.ts +21 -0
- package/dist/lib/plugins/tools/routes-extractor-worker.d.ts.map +1 -0
- package/dist/lib/plugins/tools/routes-extractor-worker.js +46 -0
- package/dist/lib/plugins/tools/worker-pool.d.ts +13 -0
- package/dist/lib/plugins/tools/worker-pool.d.ts.map +1 -0
- package/dist/lib/plugins/tools/worker-pool.js +26 -0
- package/dist/lib/utils/index-file/add-body-script.d.ts +2 -0
- package/dist/lib/utils/index-file/add-body-script.d.ts.map +1 -0
- package/dist/lib/utils/index-file/add-body-script.js +15 -0
- package/dist/lib/utils/index-file/get-index-output-file.d.ts +3 -0
- package/dist/lib/utils/index-file/get-index-output-file.d.ts.map +1 -0
- package/dist/lib/utils/index-file/get-index-output-file.js +10 -0
- package/dist/lib/utils/max-workers.d.ts +2 -0
- package/dist/lib/utils/max-workers.d.ts.map +1 -0
- package/dist/lib/utils/max-workers.js +21 -0
- package/dist/lib/utils/postcss-cli-resources.d.ts +22 -0
- package/dist/lib/utils/postcss-cli-resources.d.ts.map +1 -0
- package/dist/lib/utils/postcss-cli-resources.js +158 -0
- package/dist/lib/utils/postcss-configuration.d.ts +18 -0
- package/dist/lib/utils/postcss-configuration.d.ts.map +1 -0
- package/dist/lib/utils/postcss-configuration.js +89 -0
- package/package.json +19 -5
- package/dist/lib/config/dev-server-config-utils.d.ts +0 -4
- package/dist/lib/config/dev-server-config-utils.d.ts.map +0 -1
- package/dist/lib/config/dev-server-config-utils.js +0 -107
- package/dist/lib/config/entry-points.d.ts.map +0 -1
- package/dist/lib/config/helpers.d.ts +0 -14
- package/dist/lib/config/helpers.d.ts.map +0 -1
- package/dist/lib/config/style-config-utils.d.ts +0 -22
- package/dist/lib/config/style-config-utils.d.ts.map +0 -1
- package/dist/lib/config/style-config-utils.js +0 -202
- package/dist/lib/utils/tailwind.d.ts +0 -2
- package/dist/lib/utils/tailwind.d.ts.map +0 -1
- package/dist/lib/utils/tailwind.js +0 -31
- /package/dist/lib/config/{entry-points.js → config-utils/entry-points.js} +0 -0
|
@@ -0,0 +1,158 @@
|
|
|
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.postcss = void 0;
|
|
11
|
+
exports.default = default_1;
|
|
12
|
+
const tslib_1 = require("tslib");
|
|
13
|
+
const loader_utils_1 = require("loader-utils");
|
|
14
|
+
const path = tslib_1.__importStar(require("node:path"));
|
|
15
|
+
const url = tslib_1.__importStar(require("node:url"));
|
|
16
|
+
const misc_helpers_1 = require("./misc-helpers");
|
|
17
|
+
function wrapUrl(url) {
|
|
18
|
+
let wrappedUrl;
|
|
19
|
+
const hasSingleQuotes = url.indexOf("'") >= 0;
|
|
20
|
+
if (hasSingleQuotes) {
|
|
21
|
+
wrappedUrl = `"${url}"`;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
wrappedUrl = `'${url}'`;
|
|
25
|
+
}
|
|
26
|
+
return `url(${wrappedUrl})`;
|
|
27
|
+
}
|
|
28
|
+
async function resolve(file, base, resolver) {
|
|
29
|
+
try {
|
|
30
|
+
return await resolver('./' + file, base);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return resolver(file, base);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.postcss = true;
|
|
37
|
+
function default_1(options) {
|
|
38
|
+
if (!options) {
|
|
39
|
+
throw new Error('No options were specified to "postcss-cli-resources".');
|
|
40
|
+
}
|
|
41
|
+
const { deployUrl = '', resourcesOutputPath = '', filename, loader, emitFile, extracted, } = options;
|
|
42
|
+
const process = async (inputUrl, context, resourceCache) => {
|
|
43
|
+
// If root-relative, absolute or protocol relative url, leave as is
|
|
44
|
+
if (/^((?:\w+:)?\/\/|data:|chrome:|#)/.test(inputUrl)) {
|
|
45
|
+
return inputUrl;
|
|
46
|
+
}
|
|
47
|
+
if (/^\//.test(inputUrl)) {
|
|
48
|
+
return inputUrl;
|
|
49
|
+
}
|
|
50
|
+
// If starts with a caret, remove and return remainder
|
|
51
|
+
// this supports bypassing asset processing
|
|
52
|
+
if (inputUrl.startsWith('^')) {
|
|
53
|
+
return inputUrl.slice(1);
|
|
54
|
+
}
|
|
55
|
+
const cacheKey = path.resolve(context, inputUrl);
|
|
56
|
+
const cachedUrl = resourceCache.get(cacheKey);
|
|
57
|
+
if (cachedUrl) {
|
|
58
|
+
return cachedUrl;
|
|
59
|
+
}
|
|
60
|
+
if (inputUrl.startsWith('~')) {
|
|
61
|
+
inputUrl = inputUrl.slice(1);
|
|
62
|
+
}
|
|
63
|
+
const { pathname, hash, search } = url.parse(inputUrl.replace(/\\/g, '/'));
|
|
64
|
+
const resolver = (file, base) => new Promise((resolve, reject) => {
|
|
65
|
+
loader.resolve(base, decodeURI(file), (err, result) => {
|
|
66
|
+
if (err) {
|
|
67
|
+
reject(err);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
resolve(result);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
const result = await resolve(pathname, context, resolver);
|
|
74
|
+
return new Promise((resolve, reject) => {
|
|
75
|
+
loader.fs.readFile(result, (err, content) => {
|
|
76
|
+
if (err) {
|
|
77
|
+
reject(err);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
let outputPath = (0, loader_utils_1.interpolateName)(
|
|
81
|
+
// TODO: Revisit. Previously due to lack of type safety, this object
|
|
82
|
+
// was fine, but in practice it doesn't match the type of the loader context.
|
|
83
|
+
{ resourcePath: result }, filename(result), {
|
|
84
|
+
content,
|
|
85
|
+
context: loader.context || loader.rootContext,
|
|
86
|
+
}).replace(/\\|\//g, '-');
|
|
87
|
+
if (resourcesOutputPath) {
|
|
88
|
+
outputPath = path.posix.join(resourcesOutputPath, outputPath);
|
|
89
|
+
}
|
|
90
|
+
loader.addDependency(result);
|
|
91
|
+
if (emitFile) {
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
93
|
+
loader.emitFile(outputPath, content, undefined, {
|
|
94
|
+
sourceFilename: result,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
let outputUrl = outputPath.replace(/\\/g, '/');
|
|
98
|
+
if (hash || search) {
|
|
99
|
+
outputUrl = url.format({ pathname: outputUrl, hash, search });
|
|
100
|
+
}
|
|
101
|
+
if (deployUrl && !extracted) {
|
|
102
|
+
outputUrl = url.resolve(deployUrl, outputUrl);
|
|
103
|
+
}
|
|
104
|
+
resourceCache.set(cacheKey, outputUrl);
|
|
105
|
+
resolve(outputUrl);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
const resourceCache = new Map();
|
|
110
|
+
const processed = Symbol('postcss-cli-resources');
|
|
111
|
+
return {
|
|
112
|
+
postcssPlugin: 'postcss-cli-resources',
|
|
113
|
+
async Declaration(decl) {
|
|
114
|
+
if (!decl.value.includes('url') || processed in decl) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const value = decl.value;
|
|
118
|
+
const urlRegex = /url(?:\(\s*(['"]?))(.*?)(?:\1\s*\))/g;
|
|
119
|
+
const segments = [];
|
|
120
|
+
let match;
|
|
121
|
+
let lastIndex = 0;
|
|
122
|
+
let modified = false;
|
|
123
|
+
// We want to load it relative to the file that imports
|
|
124
|
+
const inputFile = decl.source && decl.source.input.file;
|
|
125
|
+
const context = (inputFile && path.dirname(inputFile)) || loader.context;
|
|
126
|
+
while ((match = urlRegex.exec(value))) {
|
|
127
|
+
const originalUrl = match[2];
|
|
128
|
+
let processedUrl;
|
|
129
|
+
try {
|
|
130
|
+
processedUrl = await process(originalUrl, context ?? '', resourceCache);
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
(0, misc_helpers_1.assertIsError)(err);
|
|
134
|
+
loader.emitError(decl.error(err.message, { word: originalUrl }));
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (lastIndex < match.index) {
|
|
138
|
+
segments.push(value.slice(lastIndex, match.index));
|
|
139
|
+
}
|
|
140
|
+
if (!processedUrl || originalUrl === processedUrl) {
|
|
141
|
+
segments.push(match[0]);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
segments.push(wrapUrl(processedUrl));
|
|
145
|
+
modified = true;
|
|
146
|
+
}
|
|
147
|
+
lastIndex = match.index + match[0].length;
|
|
148
|
+
}
|
|
149
|
+
if (lastIndex < value.length) {
|
|
150
|
+
segments.push(value.slice(lastIndex));
|
|
151
|
+
}
|
|
152
|
+
if (modified) {
|
|
153
|
+
decl.value = segments.join('');
|
|
154
|
+
}
|
|
155
|
+
decl[processed] = true;
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 interface PostcssConfiguration {
|
|
9
|
+
plugins: [name: string, options?: object | string][];
|
|
10
|
+
}
|
|
11
|
+
export interface SearchDirectory {
|
|
12
|
+
root: string;
|
|
13
|
+
files: Set<string>;
|
|
14
|
+
}
|
|
15
|
+
export declare function generateSearchDirectories(roots: string[]): Promise<SearchDirectory[]>;
|
|
16
|
+
export declare function findTailwindConfiguration(searchDirectories: SearchDirectory[]): string | undefined;
|
|
17
|
+
export declare function loadPostcssConfiguration(searchDirectories: SearchDirectory[]): Promise<PostcssConfiguration | undefined>;
|
|
18
|
+
//# sourceMappingURL=postcss-configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postcss-configuration.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/postcss-configuration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CACtD;AAmBD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACpB;AAED,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,MAAM,EAAE,GACd,OAAO,CAAC,eAAe,EAAE,CAAC,CAW5B;AAiBD,wBAAgB,yBAAyB,CACvC,iBAAiB,EAAE,eAAe,EAAE,GACnC,MAAM,GAAG,SAAS,CAEpB;AAWD,wBAAsB,wBAAwB,CAC5C,iBAAiB,EAAE,eAAe,EAAE,GACnC,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAkD3C"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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.generateSearchDirectories = generateSearchDirectories;
|
|
11
|
+
exports.findTailwindConfiguration = findTailwindConfiguration;
|
|
12
|
+
exports.loadPostcssConfiguration = loadPostcssConfiguration;
|
|
13
|
+
const promises_1 = require("node:fs/promises");
|
|
14
|
+
const node_path_1 = require("node:path");
|
|
15
|
+
const postcssConfigurationFiles = [
|
|
16
|
+
'postcss.config.json',
|
|
17
|
+
'.postcssrc.json',
|
|
18
|
+
];
|
|
19
|
+
const tailwindConfigFiles = [
|
|
20
|
+
'tailwind.config.js',
|
|
21
|
+
'tailwind.config.cjs',
|
|
22
|
+
'tailwind.config.mjs',
|
|
23
|
+
'tailwind.config.ts',
|
|
24
|
+
];
|
|
25
|
+
async function generateSearchDirectories(roots) {
|
|
26
|
+
return await Promise.all(roots.map((root) => (0, promises_1.readdir)(root, { withFileTypes: true }).then((entries) => ({
|
|
27
|
+
root,
|
|
28
|
+
files: new Set(entries.filter((entry) => entry.isFile()).map((entry) => entry.name)),
|
|
29
|
+
}))));
|
|
30
|
+
}
|
|
31
|
+
function findFile(searchDirectories, potentialFiles) {
|
|
32
|
+
for (const { root, files } of searchDirectories) {
|
|
33
|
+
for (const potential of potentialFiles) {
|
|
34
|
+
if (files.has(potential)) {
|
|
35
|
+
return (0, node_path_1.join)(root, potential);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
function findTailwindConfiguration(searchDirectories) {
|
|
42
|
+
return findFile(searchDirectories, tailwindConfigFiles);
|
|
43
|
+
}
|
|
44
|
+
async function readPostcssConfiguration(configurationFile) {
|
|
45
|
+
const data = await (0, promises_1.readFile)(configurationFile, 'utf-8');
|
|
46
|
+
const config = JSON.parse(data);
|
|
47
|
+
return config;
|
|
48
|
+
}
|
|
49
|
+
async function loadPostcssConfiguration(searchDirectories) {
|
|
50
|
+
const configPath = findFile(searchDirectories, postcssConfigurationFiles);
|
|
51
|
+
if (!configPath) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
const raw = await readPostcssConfiguration(configPath);
|
|
55
|
+
// If no plugins are defined, consider it equivalent to no configuration
|
|
56
|
+
if (!raw.plugins || typeof raw.plugins !== 'object') {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
// Normalize plugin array form
|
|
60
|
+
if (Array.isArray(raw.plugins)) {
|
|
61
|
+
if (raw.plugins.length < 1) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
const config = { plugins: [] };
|
|
65
|
+
for (const element of raw.plugins) {
|
|
66
|
+
if (typeof element === 'string') {
|
|
67
|
+
config.plugins.push([element]);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
config.plugins.push(element);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return config;
|
|
74
|
+
}
|
|
75
|
+
// Normalize plugin object map form
|
|
76
|
+
const entries = Object.entries(raw.plugins);
|
|
77
|
+
if (entries.length < 1) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const config = { plugins: [] };
|
|
81
|
+
for (const [name, options] of entries) {
|
|
82
|
+
if (!options ||
|
|
83
|
+
(typeof options !== 'object' && typeof options !== 'string')) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
config.plugins.push([name, options]);
|
|
87
|
+
}
|
|
88
|
+
return config;
|
|
89
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular-rspack",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.9.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"types": "./dist/lib/plugins/loaders/angular-transform.loader.d.ts",
|
|
39
39
|
"default": "./dist/lib/plugins/loaders/angular-transform.loader.js"
|
|
40
40
|
},
|
|
41
|
+
"./loaders/platform-server-exports-loader": {
|
|
42
|
+
"types": "./dist/lib/plugins/loaders/platform-server-exports.loader.d.ts",
|
|
43
|
+
"default": "./dist/lib/plugins/loaders/platform-server-exports.loader.js"
|
|
44
|
+
},
|
|
41
45
|
"./ssr": {
|
|
42
46
|
"types": "./dist/lib/ssr/server.d.ts",
|
|
43
47
|
"default": "./dist/lib/ssr/server.js"
|
|
@@ -46,7 +50,7 @@
|
|
|
46
50
|
"dependencies": {
|
|
47
51
|
"@ampproject/remapping": "2.3.0",
|
|
48
52
|
"@babel/core": "7.26.10",
|
|
49
|
-
"@nx/devkit": "21.0.0
|
|
53
|
+
"@nx/devkit": "21.0.0",
|
|
50
54
|
"autoprefixer": "10.4.21",
|
|
51
55
|
"deepmerge": "^4.3.1",
|
|
52
56
|
"express": "4.21.1",
|
|
@@ -54,7 +58,9 @@
|
|
|
54
58
|
"jsonc-parser": "^3.3.1",
|
|
55
59
|
"less-loader": "^12.2.0",
|
|
56
60
|
"license-webpack-plugin": "^4.0.2",
|
|
61
|
+
"loader-utils": "3.3.1",
|
|
57
62
|
"parse5-html-rewriting-stream": "7.0.0",
|
|
63
|
+
"piscina": "4.9.2",
|
|
58
64
|
"postcss": "8.5.3",
|
|
59
65
|
"postcss-loader": "8.1.1",
|
|
60
66
|
"resolve-url-loader": "^5.0.0",
|
|
@@ -64,7 +70,7 @@
|
|
|
64
70
|
"tslib": "^2.3.0",
|
|
65
71
|
"webpack-merge": "^6.0.1",
|
|
66
72
|
"ws": "^8.18.0",
|
|
67
|
-
"@nx/angular-rspack-compiler": "20.
|
|
73
|
+
"@nx/angular-rspack-compiler": "20.9.0"
|
|
68
74
|
},
|
|
69
75
|
"devDependencies": {
|
|
70
76
|
"@code-pushup/models": "^0.63.0",
|
|
@@ -76,9 +82,11 @@
|
|
|
76
82
|
"@angular/common": ">=19.0.0 <20.0.0",
|
|
77
83
|
"@angular/build": ">=19.0.0 <20.0.0",
|
|
78
84
|
"@angular/localize": ">=19.0.0 <20.0.0",
|
|
85
|
+
"@angular/platform-server": ">=19.0.0 <20.0.0",
|
|
86
|
+
"zone.js": ">=0.14.0 <0.16.0",
|
|
79
87
|
"@angular/ssr": ">=19.0.0 <20.0.0",
|
|
80
|
-
"@rspack/core": ">=1.
|
|
81
|
-
"tailwindcss": "^2.0.0 || ^3.0.0"
|
|
88
|
+
"@rspack/core": ">=1.3.5 <2.0.0",
|
|
89
|
+
"tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0"
|
|
82
90
|
},
|
|
83
91
|
"peerDependenciesMeta": {
|
|
84
92
|
"tailwindcss": {
|
|
@@ -86,6 +94,12 @@
|
|
|
86
94
|
},
|
|
87
95
|
"@angular/localize": {
|
|
88
96
|
"optional": true
|
|
97
|
+
},
|
|
98
|
+
"@angular/platform-server": {
|
|
99
|
+
"optional": true
|
|
100
|
+
},
|
|
101
|
+
"zone.js": {
|
|
102
|
+
"optional": true
|
|
89
103
|
}
|
|
90
104
|
},
|
|
91
105
|
"nx": {
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DevServer } from '@rspack/core';
|
|
2
|
-
export declare function getAllowedHostsConfig(allowedHosts: string[] | boolean | undefined, disableHostCheck: boolean | undefined): "all" | string[] | undefined;
|
|
3
|
-
export declare function getProxyConfig(root: string, proxyConfig: string | undefined): Promise<DevServer['proxy'] | undefined>;
|
|
4
|
-
//# sourceMappingURL=dev-server-config-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server-config-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/config/dev-server-config-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAO9C,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,GAAG,SAAS,EAC5C,gBAAgB,EAAE,OAAO,GAAG,SAAS,gCAUtC;AAED,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,CA2EzC"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAllowedHostsConfig = getAllowedHostsConfig;
|
|
4
|
-
exports.getProxyConfig = getProxyConfig;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const node_assert_1 = tslib_1.__importDefault(require("node:assert"));
|
|
7
|
-
const node_fs_1 = require("node:fs");
|
|
8
|
-
const node_path_1 = require("node:path");
|
|
9
|
-
const node_url_1 = require("node:url");
|
|
10
|
-
const misc_helpers_1 = require("../utils/misc-helpers");
|
|
11
|
-
function getAllowedHostsConfig(allowedHosts, disableHostCheck) {
|
|
12
|
-
if (disableHostCheck || allowedHosts === true) {
|
|
13
|
-
return 'all';
|
|
14
|
-
}
|
|
15
|
-
if (Array.isArray(allowedHosts) && allowedHosts.length > 0) {
|
|
16
|
-
return allowedHosts;
|
|
17
|
-
}
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
async function getProxyConfig(root, proxyConfig) {
|
|
21
|
-
if (!proxyConfig) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
const proxyPath = (0, node_path_1.resolve)(root, proxyConfig);
|
|
25
|
-
if (!(0, node_fs_1.existsSync)(proxyPath)) {
|
|
26
|
-
throw new Error(`Proxy configuration file ${proxyPath} does not exist.`);
|
|
27
|
-
}
|
|
28
|
-
let proxyConfiguration;
|
|
29
|
-
switch ((0, node_path_1.extname)(proxyPath)) {
|
|
30
|
-
case '.json': {
|
|
31
|
-
const content = await node_fs_1.promises.readFile(proxyPath, 'utf-8');
|
|
32
|
-
const { parse, printParseErrorCode } = await Promise.resolve().then(() => tslib_1.__importStar(require('jsonc-parser')));
|
|
33
|
-
const parseErrors = [];
|
|
34
|
-
proxyConfiguration = parse(content, parseErrors, {
|
|
35
|
-
allowTrailingComma: true,
|
|
36
|
-
});
|
|
37
|
-
if (parseErrors.length > 0) {
|
|
38
|
-
let errorMessage = `Proxy configuration file ${proxyPath} contains parse errors:`;
|
|
39
|
-
for (const parseError of parseErrors) {
|
|
40
|
-
const { line, column } = getJsonErrorLineColumn(parseError.offset, content);
|
|
41
|
-
errorMessage += `\n[${line}, ${column}] ${printParseErrorCode(parseError.error)}`;
|
|
42
|
-
}
|
|
43
|
-
throw new Error(errorMessage);
|
|
44
|
-
}
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
case '.mjs':
|
|
48
|
-
// Load the ESM configuration file using the TypeScript dynamic import workaround.
|
|
49
|
-
// Once TypeScript provides support for keeping the dynamic import this workaround can be
|
|
50
|
-
// changed to a direct dynamic import.
|
|
51
|
-
proxyConfiguration = (await (0, misc_helpers_1.loadEsmModule)((0, node_url_1.pathToFileURL)(proxyPath))).default;
|
|
52
|
-
break;
|
|
53
|
-
case '.cjs':
|
|
54
|
-
proxyConfiguration = require(proxyPath);
|
|
55
|
-
break;
|
|
56
|
-
default:
|
|
57
|
-
// The file could be either CommonJS or ESM.
|
|
58
|
-
// CommonJS is tried first then ESM if loading fails.
|
|
59
|
-
try {
|
|
60
|
-
proxyConfiguration = require(proxyPath);
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
assertIsError(e);
|
|
64
|
-
if (e.code !== 'ERR_REQUIRE_ESM') {
|
|
65
|
-
throw e;
|
|
66
|
-
}
|
|
67
|
-
// Load the ESM configuration file using the TypeScript dynamic import workaround.
|
|
68
|
-
// Once TypeScript provides support for keeping the dynamic import this workaround can be
|
|
69
|
-
// changed to a direct dynamic import.
|
|
70
|
-
proxyConfiguration = (await (0, misc_helpers_1.loadEsmModule)((0, node_url_1.pathToFileURL)(proxyPath))).default;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return normalizeProxyConfiguration(proxyConfiguration);
|
|
74
|
-
}
|
|
75
|
-
function getJsonErrorLineColumn(offset, content) {
|
|
76
|
-
if (offset === 0) {
|
|
77
|
-
return { line: 1, column: 1 };
|
|
78
|
-
}
|
|
79
|
-
let line = 0;
|
|
80
|
-
let position = 0;
|
|
81
|
-
while (true) {
|
|
82
|
-
++line;
|
|
83
|
-
const nextNewline = content.indexOf('\n', position);
|
|
84
|
-
if (nextNewline === -1 || nextNewline > offset) {
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
position = nextNewline + 1;
|
|
88
|
-
}
|
|
89
|
-
return { line, column: offset - position + 1 };
|
|
90
|
-
}
|
|
91
|
-
function normalizeProxyConfiguration(proxy) {
|
|
92
|
-
return Array.isArray(proxy)
|
|
93
|
-
? proxy
|
|
94
|
-
: Object.entries(proxy).map(([context, value]) => ({
|
|
95
|
-
context: [context],
|
|
96
|
-
...value,
|
|
97
|
-
}));
|
|
98
|
-
}
|
|
99
|
-
function assertIsError(value) {
|
|
100
|
-
const isError = value instanceof Error ||
|
|
101
|
-
// The following is needing to identify errors coming from RxJs.
|
|
102
|
-
(typeof value === 'object' &&
|
|
103
|
-
value &&
|
|
104
|
-
'name' in value &&
|
|
105
|
-
'message' in value);
|
|
106
|
-
(0, node_assert_1.default)(isError, 'catch clause variable is not an Error instance');
|
|
107
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-points.d.ts","sourceRoot":"","sources":["../../../src/lib/config/entry-points.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,wBAAgB,cAAc,CAC5B,YAAY,EAAE,WAAW,EAAE,EAC3B,aAAa,EAAE,WAAW,EAAE,EAC5B,YAAY,CAAC,EAAE,OAAO,GACrB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,CAerC;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EAAE,EACnB,GAAG,EAAE,OAAO,GACX;IAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAW1B;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EAAE,EACtB,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,MAAM;YAEmB,MAAM,EAAE;GAahD"}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
import { OutputHashing, HashFormat } from '../models';
|
|
9
|
-
/**
|
|
10
|
-
* Delete an output directory, but error out if it's the root of the project.
|
|
11
|
-
*/
|
|
12
|
-
export declare function deleteOutputDir(root: string, outputPath: string, emptyOnlyDirectories?: string[]): Promise<void>;
|
|
13
|
-
export declare function getOutputHashFormat(outputHashing?: OutputHashing, length?: number): HashFormat;
|
|
14
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/config/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAItD;;GAEG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,oBAAoB,CAAC,EAAE,MAAM,EAAE,GAC9B,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED,wBAAgB,mBAAmB,CACjC,aAAa,GAAE,aAAsB,EACrC,MAAM,SAAI,GACT,UAAU,CAkCZ"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type RuleSetUseItem } from '@rspack/core';
|
|
2
|
-
import type { NormalizedAngularRspackPluginOptions } from '../models';
|
|
3
|
-
/**
|
|
4
|
-
* Returns an array of style loaders for sass and less. Both loader´s are always returned
|
|
5
|
-
*
|
|
6
|
-
* @param stylePreprocessorOptions
|
|
7
|
-
* @param sourceMap
|
|
8
|
-
*/
|
|
9
|
-
export declare function getStyleLoaders(buildOptions: NormalizedAngularRspackPluginOptions): Promise<{
|
|
10
|
-
test: RegExp;
|
|
11
|
-
rules: ({
|
|
12
|
-
oneOf: {
|
|
13
|
-
use: RuleSetUseItem[];
|
|
14
|
-
resourceQuery: RegExp;
|
|
15
|
-
}[];
|
|
16
|
-
use?: undefined;
|
|
17
|
-
} | {
|
|
18
|
-
use: RuleSetUseItem[];
|
|
19
|
-
oneOf?: undefined;
|
|
20
|
-
})[];
|
|
21
|
-
}[]>;
|
|
22
|
-
//# sourceMappingURL=style-config-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-config-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/config/style-config-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,WAAW,CAAC;AAGtE;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,YAAY,EAAE,oCAAoC;;;;;;;;;;;;KAsNnD"}
|