@ngrs/build 0.0.0-stage → 0.1.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/README.md +20 -2
- package/bin/ngrs-build.mjs +604 -0
- package/bin/ngrs.mjs +207 -0
- package/builders.json +34 -0
- package/package.json +88 -4
- package/schemas/application.schema.json +316 -0
- package/schemas/dev-server.schema.json +108 -0
- package/schemas/extract-i18n.schema.json +35 -0
- package/schemas/unit-test.schema.json +118 -0
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.cjs +231 -0
- package/schematics/ng-add/schema.json +14 -0
- package/src/architect-compat.cjs +54 -0
- package/src/architect-compat.mjs +151 -0
- package/src/budgets.mjs +212 -0
- package/src/builders/application/index.cjs +13 -0
- package/src/builders/application/index.mjs +994 -0
- package/src/builders/dev-server/index.cjs +15 -0
- package/src/builders/dev-server/index.mjs +1088 -0
- package/src/builders/extract-i18n/index.cjs +13 -0
- package/src/builders/extract-i18n/index.mjs +60 -0
- package/src/builders/unit-test/index.cjs +13 -0
- package/src/builders/unit-test/index.mjs +346 -0
- package/src/index-html.mjs +126 -0
- package/src/index.cjs +29 -0
- package/src/index.d.ts +158 -0
- package/src/index.mjs +71 -0
- package/src/ng-add.mjs +92 -0
- package/src/proxy.mjs +136 -0
- package/src/stats-table.mjs +403 -0
- package/src/workspace.d.ts +213 -0
- package/src/workspace.mjs +850 -0
package/bin/ngrs.mjs
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'node:child_process';
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import { mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';
|
|
6
|
+
import { createRequire } from 'node:module';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const localRequire = createRequire(import.meta.url);
|
|
12
|
+
const pkgJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
|
|
13
|
+
|
|
14
|
+
const BUILD_DELEGATE_COMMANDS = new Set([
|
|
15
|
+
'init',
|
|
16
|
+
'build',
|
|
17
|
+
'b',
|
|
18
|
+
'serve',
|
|
19
|
+
's',
|
|
20
|
+
'dev',
|
|
21
|
+
'test',
|
|
22
|
+
't',
|
|
23
|
+
'extract-i18n',
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
const HELP_TEXT = `\
|
|
27
|
+
ngrs v${pkgJson.version} — Native Rust Angular Compiler, Ivy Linker & Application Builder CLI
|
|
28
|
+
|
|
29
|
+
USAGE:
|
|
30
|
+
ngrs init [project] [--dry-run]
|
|
31
|
+
ngrs build [project] [options]
|
|
32
|
+
ngrs serve [project] [options]
|
|
33
|
+
ngrs test [project] [options]
|
|
34
|
+
ngrs compile [-p <tsconfig.json>]
|
|
35
|
+
ngrs xi18n [-p <tsconfig.json>] [--i18nFormat xlf|xlf2|xmb] [--outFile messages.xlf]
|
|
36
|
+
ngrs link <input-file-or-dir> [-o <output-file-or-dir>] [--source-map]
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
function delegateToNgrsBuild(argv) {
|
|
40
|
+
const scriptPath = path.join(__dirname, 'ngrs-build.mjs');
|
|
41
|
+
return new Promise((resolve) => {
|
|
42
|
+
const child = spawn(process.execPath, [scriptPath, ...argv], {
|
|
43
|
+
stdio: 'inherit',
|
|
44
|
+
});
|
|
45
|
+
child.on('exit', (code) => resolve(code ?? 0));
|
|
46
|
+
child.on('error', (err) => {
|
|
47
|
+
console.error(err.message);
|
|
48
|
+
resolve(1);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function runLinkCommand(argv) {
|
|
54
|
+
const napi = localRequire('@ngrs/napi');
|
|
55
|
+
let inputTarget = null;
|
|
56
|
+
let outputTarget = null;
|
|
57
|
+
let sourceMapping = false;
|
|
58
|
+
|
|
59
|
+
for (let i = 0; i < argv.length; i++) {
|
|
60
|
+
const arg = argv[i];
|
|
61
|
+
if (arg === '-h' || arg === '--help') {
|
|
62
|
+
process.stdout.write(HELP_TEXT);
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
if (arg === '--source-map' || arg === '--sourceMap') {
|
|
66
|
+
sourceMapping = true;
|
|
67
|
+
} else if (arg === '-o' || arg === '--output') {
|
|
68
|
+
outputTarget = argv[++i];
|
|
69
|
+
} else if (!arg.startsWith('-') && !inputTarget) {
|
|
70
|
+
inputTarget = arg;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (!inputTarget) {
|
|
75
|
+
console.error('error: Missing input file or directory for `ngrs link`.');
|
|
76
|
+
return 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const absIn = path.resolve(process.cwd(), inputTarget);
|
|
80
|
+
const absOut = outputTarget ? path.resolve(process.cwd(), outputTarget) : absIn;
|
|
81
|
+
const st = await stat(absIn);
|
|
82
|
+
|
|
83
|
+
async function processSingleFile(srcFile, dstFile) {
|
|
84
|
+
const code = await readFile(srcFile, 'utf8');
|
|
85
|
+
if (!napi.needsLinking(srcFile, code) && !code.includes('\\u0275')) {
|
|
86
|
+
if (srcFile !== dstFile) {
|
|
87
|
+
await mkdir(path.dirname(dstFile), { recursive: true });
|
|
88
|
+
await writeFile(dstFile, code, 'utf8');
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
const res = napi.linkFile(srcFile, code, { sourceMapping });
|
|
93
|
+
await mkdir(path.dirname(dstFile), { recursive: true });
|
|
94
|
+
await writeFile(dstFile, res.code, 'utf8');
|
|
95
|
+
if (sourceMapping && res.sourceMap) {
|
|
96
|
+
await writeFile(`${dstFile}.map`, res.sourceMap, 'utf8');
|
|
97
|
+
}
|
|
98
|
+
return res.linked;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (st.isFile()) {
|
|
102
|
+
await processSingleFile(absIn, absOut);
|
|
103
|
+
return 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async function walkDir(currIn, currOut) {
|
|
107
|
+
const entries = await readdir(currIn, { withFileTypes: true });
|
|
108
|
+
for (const ent of entries) {
|
|
109
|
+
const nextIn = path.join(currIn, ent.name);
|
|
110
|
+
const nextOut = path.join(currOut, ent.name);
|
|
111
|
+
if (ent.isDirectory()) {
|
|
112
|
+
await walkDir(nextIn, nextOut);
|
|
113
|
+
} else if (ent.isFile() && /\.[cm]?js$/.test(ent.name)) {
|
|
114
|
+
await processSingleFile(nextIn, nextOut);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
await walkDir(absIn, absOut);
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async function runCompileOrXi18n(mode, argv) {
|
|
123
|
+
const napi = localRequire('@ngrs/napi');
|
|
124
|
+
let project = 'tsconfig.json';
|
|
125
|
+
let format = 'xlf';
|
|
126
|
+
let locale;
|
|
127
|
+
let outFile;
|
|
128
|
+
let outputPath;
|
|
129
|
+
|
|
130
|
+
for (let i = 0; i < argv.length; i++) {
|
|
131
|
+
const arg = argv[i];
|
|
132
|
+
if (arg === '-p' || arg === '--project') {
|
|
133
|
+
project = argv[++i];
|
|
134
|
+
} else if (arg === '--i18nFormat' || arg === '--format') {
|
|
135
|
+
format = argv[++i];
|
|
136
|
+
} else if (arg === '--locale') {
|
|
137
|
+
locale = argv[++i];
|
|
138
|
+
} else if (arg === '--outFile' || arg === '--out-file') {
|
|
139
|
+
outFile = argv[++i];
|
|
140
|
+
} else if (arg === '--outputPath' || arg === '--output-path') {
|
|
141
|
+
outputPath = argv[++i];
|
|
142
|
+
} else if (!arg.startsWith('-') && project === 'tsconfig.json') {
|
|
143
|
+
project = arg;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const absProject = path.resolve(process.cwd(), project);
|
|
148
|
+
const resolvedTsconfig =
|
|
149
|
+
fs.existsSync(absProject) && fs.statSync(absProject).isDirectory()
|
|
150
|
+
? path.join(absProject, 'tsconfig.json')
|
|
151
|
+
: absProject;
|
|
152
|
+
|
|
153
|
+
if (mode === 'xi18n') {
|
|
154
|
+
const res = napi.extractI18nForProject(resolvedTsconfig, {
|
|
155
|
+
format,
|
|
156
|
+
locale,
|
|
157
|
+
outputPath,
|
|
158
|
+
outFile,
|
|
159
|
+
});
|
|
160
|
+
for (const d of res.diagnostics || []) {
|
|
161
|
+
console.error(`${d.category}: ${d.message}`);
|
|
162
|
+
}
|
|
163
|
+
return res.exitCode ?? 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const res = napi.compileProjectOnDisk(resolvedTsconfig);
|
|
167
|
+
for (const d of res.diagnostics || []) {
|
|
168
|
+
console.error(`${d.file ? `${d.file}:${d.line || 1}:${d.column || 1} - ` : ''}${d.category}: ${d.message}`);
|
|
169
|
+
}
|
|
170
|
+
return res.exitCode ?? 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async function main() {
|
|
174
|
+
const argv = process.argv.slice(2);
|
|
175
|
+
const first = argv[0];
|
|
176
|
+
|
|
177
|
+
if (!first || first === '-h' || first === '--help' || first === 'help') {
|
|
178
|
+
process.stdout.write(HELP_TEXT);
|
|
179
|
+
return 0;
|
|
180
|
+
}
|
|
181
|
+
if (first === '-v' || first === '-V' || first === '--version' || first === 'version') {
|
|
182
|
+
process.stdout.write(`ngrs ${pkgJson.version}\n`);
|
|
183
|
+
return 0;
|
|
184
|
+
}
|
|
185
|
+
if (BUILD_DELEGATE_COMMANDS.has(first)) {
|
|
186
|
+
return delegateToNgrsBuild(argv);
|
|
187
|
+
}
|
|
188
|
+
if (first === 'link') {
|
|
189
|
+
return runLinkCommand(argv.slice(1));
|
|
190
|
+
}
|
|
191
|
+
if (first === 'xi18n') {
|
|
192
|
+
return runCompileOrXi18n('xi18n', argv.slice(1));
|
|
193
|
+
}
|
|
194
|
+
if (first === 'compile') {
|
|
195
|
+
return runCompileOrXi18n('compile', argv.slice(1));
|
|
196
|
+
}
|
|
197
|
+
return runCompileOrXi18n('compile', argv);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
main()
|
|
201
|
+
.then((code) => {
|
|
202
|
+
process.exitCode = code;
|
|
203
|
+
})
|
|
204
|
+
.catch((err) => {
|
|
205
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
206
|
+
process.exitCode = 1;
|
|
207
|
+
});
|
package/builders.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"builders": {
|
|
3
|
+
"application": {
|
|
4
|
+
"implementation": "./src/builders/application/index.cjs",
|
|
5
|
+
"schema": "./schemas/application.schema.json",
|
|
6
|
+
"description": "Build an Angular application with @ngrs/build (native Rust compiler + Vite)."
|
|
7
|
+
},
|
|
8
|
+
"browser-esbuild": {
|
|
9
|
+
"implementation": "./src/builders/application/index.cjs",
|
|
10
|
+
"schema": "./schemas/application.schema.json",
|
|
11
|
+
"description": "Build an Angular browser application (esbuild-compatible facade) with @ngrs/build."
|
|
12
|
+
},
|
|
13
|
+
"browser": {
|
|
14
|
+
"implementation": "./src/builders/application/index.cjs",
|
|
15
|
+
"schema": "./schemas/application.schema.json",
|
|
16
|
+
"description": "Build an Angular browser application (legacy browser-builder compatible) with @ngrs/build."
|
|
17
|
+
},
|
|
18
|
+
"dev-server": {
|
|
19
|
+
"implementation": "./src/builders/dev-server/index.cjs",
|
|
20
|
+
"schema": "./schemas/dev-server.schema.json",
|
|
21
|
+
"description": "Execute a Vite development server for an Angular application with @ngrs/build."
|
|
22
|
+
},
|
|
23
|
+
"extract-i18n": {
|
|
24
|
+
"implementation": "./src/builders/extract-i18n/index.cjs",
|
|
25
|
+
"schema": "./schemas/extract-i18n.schema.json",
|
|
26
|
+
"description": "Extract i18n messages from an Angular application with @ngrs/build."
|
|
27
|
+
},
|
|
28
|
+
"unit-test": {
|
|
29
|
+
"implementation": "./src/builders/unit-test/index.cjs",
|
|
30
|
+
"schema": "./schemas/unit-test.schema.json",
|
|
31
|
+
"description": "Run Angular unit tests with Vitest & @ngrs/vite (1:1 compatible with @angular/build:unit-test)."
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,90 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrs/build",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "1:1 Angular CLI compatible Application Builder, Vite Dev-Server & CLI powered by @ngrs/napi and @ngrs/vite",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"builders": "./builders.json",
|
|
7
|
+
"schematics": "./schematics/collection.json",
|
|
8
|
+
"ng-add": {
|
|
9
|
+
"save": "devDependencies"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"ngrs": "bin/ngrs.mjs",
|
|
13
|
+
"ngrs-build": "bin/ngrs-build.mjs"
|
|
14
|
+
},
|
|
15
|
+
"main": "./src/index.cjs",
|
|
16
|
+
"module": "./src/index.mjs",
|
|
17
|
+
"types": "./src/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./src/index.d.ts",
|
|
21
|
+
"import": "./src/index.mjs",
|
|
22
|
+
"require": "./src/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./workspace": {
|
|
25
|
+
"types": "./src/workspace.d.ts",
|
|
26
|
+
"import": "./src/workspace.mjs"
|
|
27
|
+
},
|
|
28
|
+
"./builders/application": {
|
|
29
|
+
"import": "./src/builders/application/index.mjs",
|
|
30
|
+
"require": "./src/builders/application/index.cjs"
|
|
31
|
+
},
|
|
32
|
+
"./builders/dev-server": {
|
|
33
|
+
"import": "./src/builders/dev-server/index.mjs",
|
|
34
|
+
"require": "./src/builders/dev-server/index.cjs"
|
|
35
|
+
},
|
|
36
|
+
"./builders/extract-i18n": {
|
|
37
|
+
"import": "./src/builders/extract-i18n/index.mjs",
|
|
38
|
+
"require": "./src/builders/extract-i18n/index.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./builders/unit-test": {
|
|
41
|
+
"import": "./src/builders/unit-test/index.mjs",
|
|
42
|
+
"require": "./src/builders/unit-test/index.cjs"
|
|
43
|
+
},
|
|
44
|
+
"./schematics/*": "./schematics/*",
|
|
45
|
+
"./package.json": "./package.json"
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"bin",
|
|
49
|
+
"builders.json",
|
|
50
|
+
"schemas",
|
|
51
|
+
"schematics",
|
|
52
|
+
"src"
|
|
53
|
+
],
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@ngrs/napi": "0.1.0",
|
|
56
|
+
"@ngrs/vite": "0.1.0",
|
|
57
|
+
"happy-dom": "^20.0.0",
|
|
58
|
+
"jsonc-parser": "^3.3.1",
|
|
59
|
+
"mrmime": "^2.0.1",
|
|
60
|
+
"picomatch": "^4.0.2",
|
|
61
|
+
"sass": "^1.85.0",
|
|
62
|
+
"vite": "^8.3.8"
|
|
63
|
+
},
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=18.19.0"
|
|
66
|
+
},
|
|
67
|
+
"keywords": [
|
|
68
|
+
"angular",
|
|
69
|
+
"angular-cli",
|
|
70
|
+
"builder",
|
|
71
|
+
"vite",
|
|
72
|
+
"rolldown",
|
|
73
|
+
"vitest",
|
|
74
|
+
"happy-dom",
|
|
75
|
+
"rust"
|
|
76
|
+
],
|
|
77
|
+
"publishConfig": {
|
|
78
|
+
"access": "public"
|
|
79
|
+
},
|
|
80
|
+
"license": "MIT",
|
|
81
|
+
"repository": {
|
|
82
|
+
"type": "git",
|
|
83
|
+
"url": "git+https://github.com/truonglv95/ngrs.git",
|
|
84
|
+
"directory": "packages/build"
|
|
85
|
+
},
|
|
86
|
+
"homepage": "https://github.com/truonglv95/ngrs#readme",
|
|
87
|
+
"bugs": {
|
|
88
|
+
"url": "https://github.com/truonglv95/ngrs/issues"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"title": "ngrs Application Builder Schema",
|
|
4
|
+
"description": "Application and Browser builder target options (1:1 compatible with @angular/build:application and @angular-devkit/build-angular:browser).",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"browser": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The full path for the browser entry point to the application, relative to the current workspace."
|
|
10
|
+
},
|
|
11
|
+
"main": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Legacy browser entry point alias for 'browser', relative to the current workspace."
|
|
14
|
+
},
|
|
15
|
+
"server": {
|
|
16
|
+
"oneOf": [
|
|
17
|
+
{ "type": "string" },
|
|
18
|
+
{ "type": "boolean" }
|
|
19
|
+
],
|
|
20
|
+
"description": "The full path for the server entry point to the application, relative to the current workspace."
|
|
21
|
+
},
|
|
22
|
+
"polyfills": {
|
|
23
|
+
"oneOf": [
|
|
24
|
+
{
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": { "type": "string" }
|
|
27
|
+
},
|
|
28
|
+
{ "type": "string" }
|
|
29
|
+
],
|
|
30
|
+
"description": "Polyfills to include in the build (array of specifiers/files or legacy single file path)."
|
|
31
|
+
},
|
|
32
|
+
"tsConfig": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
|
|
35
|
+
},
|
|
36
|
+
"outputPath": {
|
|
37
|
+
"oneOf": [
|
|
38
|
+
{
|
|
39
|
+
"type": "object",
|
|
40
|
+
"properties": {
|
|
41
|
+
"base": { "type": "string" },
|
|
42
|
+
"browser": { "type": "string", "default": "browser" },
|
|
43
|
+
"server": { "type": "string", "default": "server" },
|
|
44
|
+
"media": { "type": "string", "default": "media" }
|
|
45
|
+
},
|
|
46
|
+
"required": ["base"],
|
|
47
|
+
"additionalProperties": false
|
|
48
|
+
},
|
|
49
|
+
{ "type": "string" }
|
|
50
|
+
],
|
|
51
|
+
"description": "Specify the output path relative to workspace root."
|
|
52
|
+
},
|
|
53
|
+
"index": {
|
|
54
|
+
"oneOf": [
|
|
55
|
+
{ "type": "string" },
|
|
56
|
+
{
|
|
57
|
+
"type": "object",
|
|
58
|
+
"properties": {
|
|
59
|
+
"input": { "type": "string" },
|
|
60
|
+
"output": { "type": "string", "default": "index.html" },
|
|
61
|
+
"preloadInitial": { "type": "boolean" }
|
|
62
|
+
},
|
|
63
|
+
"required": ["input"]
|
|
64
|
+
},
|
|
65
|
+
{ "type": "boolean" }
|
|
66
|
+
],
|
|
67
|
+
"description": "Configures the generation of the application's HTML index."
|
|
68
|
+
},
|
|
69
|
+
"assets": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"default": [],
|
|
72
|
+
"items": {
|
|
73
|
+
"oneOf": [
|
|
74
|
+
{ "type": "string" },
|
|
75
|
+
{
|
|
76
|
+
"type": "object",
|
|
77
|
+
"properties": {
|
|
78
|
+
"glob": { "type": "string" },
|
|
79
|
+
"input": { "type": "string" },
|
|
80
|
+
"output": { "type": "string", "default": "" },
|
|
81
|
+
"ignore": { "type": "array", "items": { "type": "string" } },
|
|
82
|
+
"followSymlinks": { "type": "boolean", "default": false }
|
|
83
|
+
},
|
|
84
|
+
"required": ["glob", "input"],
|
|
85
|
+
"additionalProperties": false
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"styles": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"default": [],
|
|
93
|
+
"items": {
|
|
94
|
+
"oneOf": [
|
|
95
|
+
{ "type": "string" },
|
|
96
|
+
{
|
|
97
|
+
"type": "object",
|
|
98
|
+
"properties": {
|
|
99
|
+
"input": { "type": "string" },
|
|
100
|
+
"bundleName": { "type": "string" },
|
|
101
|
+
"inject": { "type": "boolean", "default": true }
|
|
102
|
+
},
|
|
103
|
+
"required": ["input"],
|
|
104
|
+
"additionalProperties": false
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"scripts": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"default": [],
|
|
112
|
+
"items": {
|
|
113
|
+
"oneOf": [
|
|
114
|
+
{ "type": "string" },
|
|
115
|
+
{
|
|
116
|
+
"type": "object",
|
|
117
|
+
"properties": {
|
|
118
|
+
"input": { "type": "string" },
|
|
119
|
+
"bundleName": { "type": "string" },
|
|
120
|
+
"inject": { "type": "boolean", "default": true }
|
|
121
|
+
},
|
|
122
|
+
"required": ["input"],
|
|
123
|
+
"additionalProperties": false
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"inlineStyleLanguage": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"default": "css",
|
|
131
|
+
"enum": ["css", "less", "sass", "scss"]
|
|
132
|
+
},
|
|
133
|
+
"stylePreprocessorOptions": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"properties": {
|
|
136
|
+
"includePaths": {
|
|
137
|
+
"type": "array",
|
|
138
|
+
"items": { "type": "string" },
|
|
139
|
+
"default": []
|
|
140
|
+
},
|
|
141
|
+
"sass": { "type": "object" }
|
|
142
|
+
},
|
|
143
|
+
"additionalProperties": false
|
|
144
|
+
},
|
|
145
|
+
"fileReplacements": {
|
|
146
|
+
"type": "array",
|
|
147
|
+
"default": [],
|
|
148
|
+
"items": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"properties": {
|
|
151
|
+
"replace": { "type": "string" },
|
|
152
|
+
"with": { "type": "string" },
|
|
153
|
+
"replaceWith": { "type": "string" }
|
|
154
|
+
},
|
|
155
|
+
"required": ["replace"]
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"aot": { "type": "boolean", "default": true },
|
|
159
|
+
"optimization": {
|
|
160
|
+
"default": true,
|
|
161
|
+
"oneOf": [
|
|
162
|
+
{ "type": "boolean" },
|
|
163
|
+
{
|
|
164
|
+
"type": "object",
|
|
165
|
+
"properties": {
|
|
166
|
+
"scripts": { "type": "boolean", "default": true },
|
|
167
|
+
"styles": {
|
|
168
|
+
"oneOf": [
|
|
169
|
+
{ "type": "boolean" },
|
|
170
|
+
{
|
|
171
|
+
"type": "object",
|
|
172
|
+
"properties": {
|
|
173
|
+
"minify": { "type": "boolean", "default": true },
|
|
174
|
+
"inlineCritical": { "type": "boolean", "default": true },
|
|
175
|
+
"removeSpecialComments": { "type": "boolean", "default": true }
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
"fonts": {
|
|
181
|
+
"oneOf": [
|
|
182
|
+
{ "type": "boolean" },
|
|
183
|
+
{
|
|
184
|
+
"type": "object",
|
|
185
|
+
"properties": {
|
|
186
|
+
"inline": { "type": "boolean", "default": true }
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"sourceMap": {
|
|
196
|
+
"default": false,
|
|
197
|
+
"oneOf": [
|
|
198
|
+
{ "type": "boolean" },
|
|
199
|
+
{
|
|
200
|
+
"type": "object",
|
|
201
|
+
"properties": {
|
|
202
|
+
"scripts": { "type": "boolean", "default": true },
|
|
203
|
+
"styles": { "type": "boolean", "default": true },
|
|
204
|
+
"hidden": { "type": "boolean", "default": false },
|
|
205
|
+
"vendor": { "type": "boolean", "default": false },
|
|
206
|
+
"sourcesContent": { "type": "boolean", "default": true }
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
"outputHashing": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"default": "none",
|
|
214
|
+
"enum": ["none", "all", "media", "bundles"]
|
|
215
|
+
},
|
|
216
|
+
"budgets": {
|
|
217
|
+
"type": "array",
|
|
218
|
+
"default": [],
|
|
219
|
+
"items": {
|
|
220
|
+
"type": "object",
|
|
221
|
+
"properties": {
|
|
222
|
+
"type": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"enum": ["all", "allScript", "any", "anyScript", "anyComponentStyle", "bundle", "initial"]
|
|
225
|
+
},
|
|
226
|
+
"name": { "type": "string" },
|
|
227
|
+
"baseline": { "type": "string" },
|
|
228
|
+
"maximumWarning": { "type": "string" },
|
|
229
|
+
"maximumError": { "type": "string" },
|
|
230
|
+
"minimumWarning": { "type": "string" },
|
|
231
|
+
"minimumError": { "type": "string" },
|
|
232
|
+
"warning": { "type": "string" },
|
|
233
|
+
"error": { "type": "string" }
|
|
234
|
+
},
|
|
235
|
+
"required": ["type"]
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"baseHref": { "type": "string" },
|
|
239
|
+
"deployUrl": { "type": "string" },
|
|
240
|
+
"define": {
|
|
241
|
+
"type": "object",
|
|
242
|
+
"additionalProperties": { "type": "string" }
|
|
243
|
+
},
|
|
244
|
+
"externalDependencies": {
|
|
245
|
+
"type": "array",
|
|
246
|
+
"items": { "type": "string" },
|
|
247
|
+
"default": []
|
|
248
|
+
},
|
|
249
|
+
"conditions": {
|
|
250
|
+
"type": "array",
|
|
251
|
+
"items": { "type": "string" }
|
|
252
|
+
},
|
|
253
|
+
"loader": {
|
|
254
|
+
"type": "object",
|
|
255
|
+
"additionalProperties": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"enum": ["text", "binary", "file", "dataurl", "base64", "empty"]
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"deleteOutputPath": { "type": "boolean", "default": true },
|
|
261
|
+
"preserveSymlinks": { "type": "boolean" },
|
|
262
|
+
"extractLicenses": { "type": "boolean", "default": true },
|
|
263
|
+
"namedChunks": { "type": "boolean", "default": false },
|
|
264
|
+
"subresourceIntegrity": { "type": "boolean", "default": false },
|
|
265
|
+
"crossOrigin": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"default": "none",
|
|
268
|
+
"enum": ["none", "anonymous", "use-credentials"]
|
|
269
|
+
},
|
|
270
|
+
"allowedCommonJsDependencies": {
|
|
271
|
+
"type": "array",
|
|
272
|
+
"items": { "type": "string" },
|
|
273
|
+
"default": []
|
|
274
|
+
},
|
|
275
|
+
"statsJson": { "type": "boolean", "default": false },
|
|
276
|
+
"watch": { "type": "boolean", "default": false },
|
|
277
|
+
"poll": { "type": "number" },
|
|
278
|
+
"verbose": { "type": "boolean", "default": false },
|
|
279
|
+
"progress": { "type": "boolean", "default": true },
|
|
280
|
+
"colors": { "type": "boolean" },
|
|
281
|
+
"clearScreen": { "type": "boolean", "default": false },
|
|
282
|
+
"serviceWorker": {
|
|
283
|
+
"oneOf": [{ "type": "boolean" }, { "type": "string" }],
|
|
284
|
+
"default": false
|
|
285
|
+
},
|
|
286
|
+
"ssr": {
|
|
287
|
+
"oneOf": [{ "type": "boolean" }, { "type": "object" }],
|
|
288
|
+
"default": false
|
|
289
|
+
},
|
|
290
|
+
"prerender": {
|
|
291
|
+
"oneOf": [{ "type": "boolean" }, { "type": "object" }]
|
|
292
|
+
},
|
|
293
|
+
"appShell": { "type": "boolean" },
|
|
294
|
+
"outputMode": { "type": "string", "enum": ["static", "server"] },
|
|
295
|
+
"localize": {
|
|
296
|
+
"oneOf": [
|
|
297
|
+
{ "type": "boolean" },
|
|
298
|
+
{ "type": "array", "items": { "type": "string" } }
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
"i18nMissingTranslation": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"enum": ["warning", "error", "ignore"],
|
|
304
|
+
"default": "warning"
|
|
305
|
+
},
|
|
306
|
+
"i18nDuplicateTranslation": {
|
|
307
|
+
"type": "string",
|
|
308
|
+
"enum": ["warning", "error", "ignore"],
|
|
309
|
+
"default": "warning"
|
|
310
|
+
},
|
|
311
|
+
"security": { "type": "object" },
|
|
312
|
+
"webWorkerTsConfig": { "type": "string" }
|
|
313
|
+
},
|
|
314
|
+
"additionalProperties": true,
|
|
315
|
+
"required": ["tsConfig"]
|
|
316
|
+
}
|