We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2d8d54 commit 9c0ce33Copy full SHA for 9c0ce33
1 file changed
scripts/build-exports.js
@@ -127,9 +127,12 @@ if (process.argv.includes('--no-tsc')) {
127
process.exit(exitCode);
128
}
129
130
- console.log('Copying declaration files for CommonJS...');
+ console.log('Building shims for CommonJS type resolution...');
131
for await (const file of fs.glob('*.d.ts', { cwd: rootDir })) {
132
- // Expected they have the same content, but this is still required for TypeScript's Node16 resolution.
133
- await fs.copyFile(dist(file), dist(file.replace('.d.ts', '.d.cts')));
+ await fs.writeFile(
+ dist(file.replace('.d.ts', '.d.cts')),
134
+ `export * from "./${file.replace('.d.ts', '.js')}";`,
135
+ 'utf8',
136
+ );
137
138
0 commit comments