nx 18.0.2 → 18.0.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.
|
@@ -145,13 +145,21 @@ exports.registerTsConfigPaths = registerTsConfigPaths;
|
|
|
145
145
|
function readCompilerOptions(tsConfigPath) {
|
|
146
146
|
const preferTsNode = process.env.NX_PREFER_TS_NODE === 'true';
|
|
147
147
|
if (swcNodeInstalled && !preferTsNode) {
|
|
148
|
-
|
|
149
|
-
return readDefaultTsConfig(tsConfigPath);
|
|
148
|
+
return readCompilerOptionsWithSwc(tsConfigPath);
|
|
150
149
|
}
|
|
151
150
|
else {
|
|
152
151
|
return readCompilerOptionsWithTypescript(tsConfigPath);
|
|
153
152
|
}
|
|
154
153
|
}
|
|
154
|
+
function readCompilerOptionsWithSwc(tsConfigPath) {
|
|
155
|
+
const { readDefaultTsConfig, } = require('@swc-node/register/read-default-tsconfig');
|
|
156
|
+
const compilerOptions = readDefaultTsConfig(tsConfigPath);
|
|
157
|
+
// This is returned in compiler options for some reason, but not part of the typings.
|
|
158
|
+
// @swc-node/register filters the files to transpile based on it, but it can be limiting when processing
|
|
159
|
+
// files not part of the received tsconfig included files (e.g. shared helpers, or config files not in source, etc.).
|
|
160
|
+
delete compilerOptions.files;
|
|
161
|
+
return compilerOptions;
|
|
162
|
+
}
|
|
155
163
|
function readCompilerOptionsWithTypescript(tsConfigPath) {
|
|
156
164
|
if (!ts) {
|
|
157
165
|
ts = require('typescript');
|