@nrwl/angular 15.6.1 → 15.6.3
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/CHANGELOG.md +1 -1
- package/package.json +8 -8
- package/src/builders/module-federation-dev-server/schema.json +2 -1
- package/src/builders/module-federation-dev-ssr/schema.json +2 -1
- package/src/builders/utilities/webpack.d.ts +1 -0
- package/src/builders/utilities/webpack.js +9 -1
- package/src/builders/utilities/webpack.js.map +1 -1
- package/src/builders/webpack-browser/schema.json +7 -1
- package/src/builders/webpack-browser/webpack-browser.impl.d.ts +1 -0
- package/src/builders/webpack-browser/webpack-browser.impl.js +20 -7
- package/src/builders/webpack-browser/webpack-browser.impl.js.map +1 -1
- package/src/builders/webpack-dev-server/schema.json +2 -1
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +17 -7
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js.map +1 -1
- package/src/builders/webpack-server/schema.json +3 -1
- package/src/executors/ng-packagr-lite/schema.json +2 -1
- package/src/executors/package/schema.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [15.6.
|
|
6
|
+
## [15.6.3](https://github.com/nrwl/nx/compare/15.6.2...15.6.3) (2023-01-27)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/angular
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/angular",
|
|
3
|
-
"version": "15.6.
|
|
3
|
+
"version": "15.6.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, Karma, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@angular-devkit/schematics": "~15.1.0",
|
|
70
|
-
"@nrwl/cypress": "15.6.
|
|
71
|
-
"@nrwl/devkit": "15.6.
|
|
72
|
-
"@nrwl/jest": "15.6.
|
|
73
|
-
"@nrwl/linter": "15.6.
|
|
74
|
-
"@nrwl/webpack": "15.6.
|
|
75
|
-
"@nrwl/workspace": "15.6.
|
|
70
|
+
"@nrwl/cypress": "15.6.3",
|
|
71
|
+
"@nrwl/devkit": "15.6.3",
|
|
72
|
+
"@nrwl/jest": "15.6.3",
|
|
73
|
+
"@nrwl/linter": "15.6.3",
|
|
74
|
+
"@nrwl/webpack": "15.6.3",
|
|
75
|
+
"@nrwl/workspace": "15.6.3",
|
|
76
76
|
"@phenomnomnominal/tsquery": "4.1.1",
|
|
77
77
|
"@schematics/angular": "~15.1.0",
|
|
78
78
|
"chalk": "^4.1.0",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"fesm2015": "fesm2015/nrwl-angular.mjs",
|
|
108
108
|
"typings": "index.d.ts",
|
|
109
109
|
"sideEffects": false,
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "4a5a231a3eca0d648408941147be509cd827dd78"
|
|
111
111
|
}
|
|
@@ -109,7 +109,8 @@
|
|
|
109
109
|
"items": {
|
|
110
110
|
"type": "string"
|
|
111
111
|
},
|
|
112
|
-
"description": "List of remote applications to run in development mode (i.e. using serve target)."
|
|
112
|
+
"description": "List of remote applications to run in development mode (i.e. using serve target).",
|
|
113
|
+
"x-priority": "important"
|
|
113
114
|
},
|
|
114
115
|
"skipRemotes": {
|
|
115
116
|
"type": "array",
|
|
@@ -65,7 +65,8 @@
|
|
|
65
65
|
"items": {
|
|
66
66
|
"type": "string"
|
|
67
67
|
},
|
|
68
|
-
"description": "List of remote applications to run in development mode (i.e. using serve target)."
|
|
68
|
+
"description": "List of remote applications to run in development mode (i.e. using serve target).",
|
|
69
|
+
"x-priority": "important"
|
|
69
70
|
},
|
|
70
71
|
"skipRemotes": {
|
|
71
72
|
"type": "array",
|
|
@@ -3,3 +3,4 @@ export declare function mergeCustomWebpackConfig(baseWebpackConfig: any, pathToW
|
|
|
3
3
|
[k: string]: any;
|
|
4
4
|
}, target: import('@angular-devkit/architect').Target): Promise<any>;
|
|
5
5
|
export declare function resolveCustomWebpackConfig(path: string, tsConfig: string): any;
|
|
6
|
+
export declare function resolveIndexHtmlTransformer(path: string, tsConfig: string, target: import('@angular-devkit/architect').Target): (indexHtml: any) => any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveCustomWebpackConfig = exports.mergeCustomWebpackConfig = void 0;
|
|
3
|
+
exports.resolveIndexHtmlTransformer = exports.resolveCustomWebpackConfig = exports.mergeCustomWebpackConfig = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const webpack_merge_1 = require("webpack-merge");
|
|
6
6
|
function mergeCustomWebpackConfig(baseWebpackConfig, pathToWebpackConfig, options, target) {
|
|
@@ -33,6 +33,14 @@ function resolveCustomWebpackConfig(path, tsConfig) {
|
|
|
33
33
|
return (_a = customWebpackConfig.default) !== null && _a !== void 0 ? _a : customWebpackConfig;
|
|
34
34
|
}
|
|
35
35
|
exports.resolveCustomWebpackConfig = resolveCustomWebpackConfig;
|
|
36
|
+
function resolveIndexHtmlTransformer(path, tsConfig, target) {
|
|
37
|
+
var _a;
|
|
38
|
+
tsNodeRegister(path, tsConfig);
|
|
39
|
+
const indexTransformer = require(path);
|
|
40
|
+
const transform = (_a = indexTransformer.default) !== null && _a !== void 0 ? _a : indexTransformer;
|
|
41
|
+
return (indexHtml) => transform(target, indexHtml);
|
|
42
|
+
}
|
|
43
|
+
exports.resolveIndexHtmlTransformer = resolveIndexHtmlTransformer;
|
|
36
44
|
function tsNodeRegister(file, tsConfig) {
|
|
37
45
|
if (!(file === null || file === void 0 ? void 0 : file.endsWith('.ts')))
|
|
38
46
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/utilities/webpack.ts"],"names":[],"mappings":";;;;AAAA,iDAAsC;AAEtC,SAAsB,wBAAwB,CAC5C,iBAAsB,EACtB,mBAA2B,EAC3B,OAA+C,EAC/C,MAAkD;;QAElD,MAAM,0BAA0B,GAAG,0BAA0B,CAC3D,mBAAmB,EACnB,OAAO,CAAC,QAAQ,CACjB,CAAC;QACF,gFAAgF;QAChF,yFAAyF;QACzF,4CAA4C;QAC5C,MAAM,MAAM,GAAG,MAAM,0BAA0B,CAAC;QAEhD,0FAA0F;QAC1F,4DAA4D;QAC5D,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,OAAO,MAAM,CAAC,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;SACnD;aAAM;YACL,OAAO,IAAA,qBAAK,EAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;SACzC;IACH,CAAC;CAAA;AAtBD,4DAsBC;AAED,SAAgB,0BAA0B,CAAC,IAAY,EAAE,QAAgB;;IACvE,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAE/B,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,kDAAkD;IAClD,oEAAoE;IACpE,qDAAqD;IACrD,6DAA6D;IAC7D,yBAAyB;IACzB,OAAO,MAAA,mBAAmB,CAAC,OAAO,mCAAI,mBAAmB,CAAC;AAC5D,CAAC;AAVD,gEAUC;AAED,SAAS,cAAc,CAAC,IAAY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Aa,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,OAAO,IAAI,KAAK,EAAE;QACpB,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;KAC5C;AACH,CAAC"}
|
|
@@ -128,7 +128,8 @@
|
|
|
128
128
|
"pattern": "\\.(?:css|scss|sass|less|styl)$"
|
|
129
129
|
}
|
|
130
130
|
]
|
|
131
|
-
}
|
|
131
|
+
},
|
|
132
|
+
"x-priority": "important"
|
|
132
133
|
},
|
|
133
134
|
"inlineStyleLanguage": {
|
|
134
135
|
"description": "The stylesheet language to use for the application's inline component styles.",
|
|
@@ -454,8 +455,13 @@
|
|
|
454
455
|
"type": "string"
|
|
455
456
|
}
|
|
456
457
|
},
|
|
458
|
+
"x-priority": "important",
|
|
457
459
|
"additionalProperties": false
|
|
458
460
|
},
|
|
461
|
+
"indexFileTransformer": {
|
|
462
|
+
"description": "Path to transformer function to transform the index.html",
|
|
463
|
+
"type": "string"
|
|
464
|
+
},
|
|
459
465
|
"buildLibsFromSource": {
|
|
460
466
|
"type": "boolean",
|
|
461
467
|
"description": "Read buildable libraries from source instead of building them separately.",
|
|
@@ -3,6 +3,7 @@ export declare type BrowserBuilderSchema = import('@angular-devkit/build-angular
|
|
|
3
3
|
customWebpackConfig?: {
|
|
4
4
|
path: string;
|
|
5
5
|
};
|
|
6
|
+
indexFileTransformer?: string;
|
|
6
7
|
buildLibsFromSource?: boolean;
|
|
7
8
|
};
|
|
8
9
|
export declare function executeWebpackBrowserBuilder(options: BrowserBuilderSchema, context: import('@angular-devkit/architect').BuilderContext): Observable<import('@angular-devkit/architect').BuilderOutput>;
|
|
@@ -9,24 +9,37 @@ const webpack_1 = require("../utilities/webpack");
|
|
|
9
9
|
const buildable_libs_1 = require("../utilities/buildable-libs");
|
|
10
10
|
const operators_1 = require("rxjs/operators");
|
|
11
11
|
function buildApp(options, context) {
|
|
12
|
-
const { buildLibsFromSource, customWebpackConfig } = options, delegateOptions = tslib_1.__rest(options, ["buildLibsFromSource", "customWebpackConfig"]);
|
|
12
|
+
const { buildLibsFromSource, customWebpackConfig, indexFileTransformer } = options, delegateOptions = tslib_1.__rest(options, ["buildLibsFromSource", "customWebpackConfig", "indexFileTransformer"]);
|
|
13
|
+
// If there is a path to an indexFileTransformer
|
|
14
|
+
// check it exists and apply it to the build
|
|
15
|
+
const pathToIndexFileTransformer = indexFileTransformer &&
|
|
16
|
+
(0, devkit_1.joinPathFragments)(context.workspaceRoot, indexFileTransformer);
|
|
17
|
+
if (pathToIndexFileTransformer && !(0, fs_1.existsSync)(pathToIndexFileTransformer)) {
|
|
18
|
+
throw new Error(`File containing Index File Transformer function Not Found!\n Please ensure the path to the file containing the function is correct: \n${pathToIndexFileTransformer}`);
|
|
19
|
+
}
|
|
13
20
|
// If there is a path to custom webpack config
|
|
14
21
|
// Invoke our own support for custom webpack config
|
|
15
22
|
if (customWebpackConfig && customWebpackConfig.path) {
|
|
16
23
|
const pathToWebpackConfig = (0, devkit_1.joinPathFragments)(context.workspaceRoot, customWebpackConfig.path);
|
|
17
24
|
if ((0, fs_1.existsSync)(pathToWebpackConfig)) {
|
|
18
|
-
return buildAppWithCustomWebpackConfiguration(delegateOptions, context, pathToWebpackConfig);
|
|
25
|
+
return buildAppWithCustomWebpackConfiguration(delegateOptions, context, pathToWebpackConfig, pathToIndexFileTransformer);
|
|
19
26
|
}
|
|
20
27
|
else {
|
|
21
28
|
throw new Error(`Custom Webpack Config File Not Found!\nTo use a custom webpack config, please ensure the path to the custom webpack file is correct: \n${pathToWebpackConfig}`);
|
|
22
29
|
}
|
|
23
30
|
}
|
|
24
|
-
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_1.switchMap)(({ executeBrowserBuilder }) => executeBrowserBuilder(delegateOptions, context
|
|
31
|
+
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_1.switchMap)(({ executeBrowserBuilder }) => executeBrowserBuilder(delegateOptions, context, Object.assign({}, (pathToIndexFileTransformer
|
|
32
|
+
? {
|
|
33
|
+
indexHtml: (0, webpack_1.resolveIndexHtmlTransformer)(pathToIndexFileTransformer, options.tsConfig, context.target),
|
|
34
|
+
}
|
|
35
|
+
: {})))));
|
|
25
36
|
}
|
|
26
|
-
function buildAppWithCustomWebpackConfiguration(options, context, pathToWebpackConfig) {
|
|
27
|
-
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_1.switchMap)(({ executeBrowserBuilder }) => executeBrowserBuilder(options, context, {
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
function buildAppWithCustomWebpackConfiguration(options, context, pathToWebpackConfig, pathToIndexFileTransformer) {
|
|
38
|
+
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_1.switchMap)(({ executeBrowserBuilder }) => executeBrowserBuilder(options, context, Object.assign({ webpackConfiguration: (baseWebpackConfig) => (0, webpack_1.mergeCustomWebpackConfig)(baseWebpackConfig, pathToWebpackConfig, options, context.target) }, (pathToIndexFileTransformer
|
|
39
|
+
? {
|
|
40
|
+
indexHtml: (0, webpack_1.resolveIndexHtmlTransformer)(pathToIndexFileTransformer, options.tsConfig, context.target),
|
|
41
|
+
}
|
|
42
|
+
: {})))));
|
|
30
43
|
}
|
|
31
44
|
function executeWebpackBrowserBuilder(options, context) {
|
|
32
45
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-browser.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/webpack-browser/webpack-browser.impl.ts"],"names":[],"mappings":";;;;AAAA,yCAAiD;AACjD,2BAAgC;AAChC,+BAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"webpack-browser.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/webpack-browser/webpack-browser.impl.ts"],"names":[],"mappings":";;;;A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|
110
|
-
"description": "Read buildable libraries from source instead of building them separately. If not set, it will take the value specified in the `browserTarget` options, or it will default to `true` if it's also not set in the `browserTarget` options."
|
|
110
|
+
"description": "Read buildable libraries from source instead of building them separately. If not set, it will take the value specified in the `browserTarget` options, or it will default to `true` if it's also not set in the `browserTarget` options.",
|
|
111
|
+
"x-priority": "important"
|
|
111
112
|
}
|
|
112
113
|
},
|
|
113
114
|
"additionalProperties": false,
|
|
@@ -14,7 +14,7 @@ const rxjs_1 = require("rxjs");
|
|
|
14
14
|
const operators_2 = require("rxjs/operators");
|
|
15
15
|
const typescript_1 = require("nx/src/utils/typescript");
|
|
16
16
|
function executeWebpackDevServerBuilder(rawOptions, context) {
|
|
17
|
-
var _a, _b, _c, _d, _e;
|
|
17
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18
18
|
process.env.NX_TSCONFIG_PATH = (0, typescript_1.getRootTsConfigPath)();
|
|
19
19
|
const options = (0, lib_1.normalizeOptions)(rawOptions);
|
|
20
20
|
const parsedBrowserTarget = (0, devkit_1.parseTargetString)(options.browserTarget, (0, devkit_1.readCachedProjectGraph)());
|
|
@@ -30,13 +30,21 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
|
|
|
30
30
|
let pathToWebpackConfig;
|
|
31
31
|
if (customWebpackConfig && customWebpackConfig.path) {
|
|
32
32
|
pathToWebpackConfig = (0, devkit_1.joinPathFragments)(context.workspaceRoot, customWebpackConfig.path);
|
|
33
|
-
if (!(0, fs_1.existsSync)(pathToWebpackConfig)) {
|
|
33
|
+
if (pathToWebpackConfig && !(0, fs_1.existsSync)(pathToWebpackConfig)) {
|
|
34
34
|
throw new Error(`Custom Webpack Config File Not Found!\nTo use a custom webpack config, please ensure the path to the custom webpack file is correct: \n${pathToWebpackConfig}`);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
const indexFileTransformer = (_e = buildTargetConfiguration === null || buildTargetConfiguration === void 0 ? void 0 : buildTargetConfiguration.indexFileTransformer) !== null && _e !== void 0 ? _e : buildTarget.options.indexFileTransformer;
|
|
38
|
+
let pathToIndexFileTransformer;
|
|
39
|
+
if (indexFileTransformer) {
|
|
40
|
+
pathToIndexFileTransformer = (0, devkit_1.joinPathFragments)(context.workspaceRoot, indexFileTransformer);
|
|
41
|
+
if (pathToIndexFileTransformer && !(0, fs_1.existsSync)(pathToIndexFileTransformer)) {
|
|
42
|
+
throw new Error(`File containing Index File Transformer function Not Found!\n Please ensure the path to the file containing the function is correct: \n${pathToIndexFileTransformer}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
37
45
|
let dependencies;
|
|
38
46
|
if (!buildLibsFromSource) {
|
|
39
|
-
const buildTargetTsConfigPath = (
|
|
47
|
+
const buildTargetTsConfigPath = (_f = buildTargetConfiguration === null || buildTargetConfiguration === void 0 ? void 0 : buildTargetConfiguration.tsConfig) !== null && _f !== void 0 ? _f : buildTarget.options.tsConfig;
|
|
40
48
|
const { tsConfigPath, dependencies: foundDependencies } = (0, buildable_libs_1.createTmpTsConfigForBuildableLibs)(buildTargetTsConfigPath, context, parsedBrowserTarget.target);
|
|
41
49
|
dependencies = foundDependencies;
|
|
42
50
|
// We can't just pass the tsconfig path in memory to the angular builder
|
|
@@ -57,8 +65,7 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
|
|
|
57
65
|
// webpack-server implementation.
|
|
58
66
|
buildTargetConfiguration.tsConfig = tsConfigPath;
|
|
59
67
|
}
|
|
60
|
-
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_2.switchMap)(({ executeDevServerBuilder }) => executeDevServerBuilder(options, context, {
|
|
61
|
-
webpackConfiguration: (baseWebpackConfig) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_2.switchMap)(({ executeDevServerBuilder }) => executeDevServerBuilder(options, context, Object.assign({ webpackConfiguration: (baseWebpackConfig) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
62
69
|
if (!buildLibsFromSource) {
|
|
63
70
|
const workspaceDependencies = dependencies
|
|
64
71
|
.filter((dep) => !(0, operators_1.isNpmProject)(dep.node))
|
|
@@ -75,8 +82,11 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
|
|
|
75
82
|
return baseWebpackConfig;
|
|
76
83
|
}
|
|
77
84
|
return (0, webpack_1.mergeCustomWebpackConfig)(baseWebpackConfig, pathToWebpackConfig, buildTargetConfiguration, context.target);
|
|
78
|
-
}),
|
|
79
|
-
|
|
85
|
+
}) }, (pathToIndexFileTransformer
|
|
86
|
+
? {
|
|
87
|
+
indexHtml: (0, webpack_1.resolveIndexHtmlTransformer)(pathToIndexFileTransformer, buildTargetConfiguration.tsConfig, context.target),
|
|
88
|
+
}
|
|
89
|
+
: {})))));
|
|
80
90
|
}
|
|
81
91
|
exports.executeWebpackDevServerBuilder = executeWebpackDevServerBuilder;
|
|
82
92
|
exports.default = require('@angular-devkit/architect').createBuilder(executeWebpackDevServerBuilder);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-dev-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/webpack-dev-server/webpack-dev-server.impl.ts"],"names":[],"mappings":";;;;AAAA,yCAIsB;AACtB,yHAAkH;AAElH,sEAAoF;AACpF,2BAAgC;AAChC,8DAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"webpack-dev-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/webpack-dev-server/webpack-dev-server.impl.ts"],"names":[],"mappings":";;;;AAAA,yCAIsB;AACtB,yHAAkH;AAElH,sEAAoF;AACpF,2BAAgC;AAChC,8DAA8D;AAC9D,kDAG8B;AAC9B,+BAAyC;AAEzC,gEAAgF;AAChF,+BAA4B;AAC5B,8CAA2C;AAC3C,wDAA8D;AAE9D,SAAgB,8BAA8B,CAC5C,UAAkB,EAClB,OAA2D;;IAE3D,OA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,CAAC;AAlJD,wEAkJC;AAED,kBAAe,OAAO,CAAC,2BAA2B,CAAC,CAAC,aAAa,CAC/D,8BAA8B,CACxB,CAAC"}
|
|
@@ -235,12 +235,14 @@
|
|
|
235
235
|
"type": "string"
|
|
236
236
|
}
|
|
237
237
|
},
|
|
238
|
+
"x-priority": "important",
|
|
238
239
|
"additionalProperties": false
|
|
239
240
|
},
|
|
240
241
|
"buildLibsFromSource": {
|
|
241
242
|
"type": "boolean",
|
|
242
243
|
"description": "Read buildable libraries from source instead of building them separately.",
|
|
243
|
-
"default": true
|
|
244
|
+
"default": true,
|
|
245
|
+
"x-priority": "important"
|
|
244
246
|
}
|
|
245
247
|
},
|
|
246
248
|
"additionalProperties": false,
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"type": "string",
|
|
30
30
|
"description": "The full path for the TypeScript configuration file, relative to the workspace root.",
|
|
31
31
|
"x-completion-type": "file",
|
|
32
|
-
"x-completion-glob": "tsconfig.*.json"
|
|
32
|
+
"x-completion-glob": "tsconfig.*.json",
|
|
33
|
+
"x-priority": "important"
|
|
33
34
|
},
|
|
34
35
|
"watch": {
|
|
35
36
|
"type": "boolean",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"type": "string",
|
|
30
30
|
"description": "The full path for the TypeScript configuration file, relative to the workspace root.",
|
|
31
31
|
"x-completion-type": "file",
|
|
32
|
-
"x-completion-glob": "tsconfig.*.json"
|
|
32
|
+
"x-completion-glob": "tsconfig.*.json",
|
|
33
|
+
"x-priority": "important"
|
|
33
34
|
},
|
|
34
35
|
"watch": {
|
|
35
36
|
"type": "boolean",
|