Skip to content

Commit 366b4e9

Browse files
committed
Add mapping of tsconfig compiler option 'moduleResolution' from string to enum.
1 parent bbe2290 commit 366b4e9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Diff for: dash/extract-meta.js

+17
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ if (!src.length) {
3838

3939
if (fs.existsSync('tsconfig.json')) {
4040
tsconfig = JSON.parse(fs.readFileSync('tsconfig.json')).compilerOptions;
41+
// Map moduleResolution to the appropriate enum.
42+
switch (tsconfig.moduleResolution) {
43+
case 'node':
44+
tsconfig.moduleResolution = ts.ModuleResolutionKind.NodeJs;
45+
break;
46+
case 'node16':
47+
tsconfig.moduleResolution = ts.ModuleResolutionKind.Node16;
48+
break;
49+
case 'nodenext':
50+
tsconfig.moduleResolution = ts.ModuleResolutionKind.NodeNext;
51+
break;
52+
case 'classic':
53+
tsconfig.moduleResolution = ts.ModuleResolutionKind.Classic;
54+
break;
55+
default:
56+
break;
57+
}
4158
}
4259

4360
let failedBuild = false;

0 commit comments

Comments
 (0)