Skip to content

Commit 9b599d2

Browse files
committed
workaround
1 parent 6a9d0b0 commit 9b599d2

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import fs from 'node:fs';
2+
import path from 'node:path';
3+
import { fileURLToPath } from 'node:url';
4+
import { dirname } from 'node:path';
5+
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = dirname(__filename);
8+
9+
const rollupDir = path.join(__dirname, '..', 'node_modules', 'rollup', 'dist');
10+
const destDir = path.join(__dirname, '..', 'node_modules', 'rollup');
11+
12+
const filesToCopy = ['parseAst.d.ts', 'parseAst.js'];
13+
14+
filesToCopy.forEach(file => {
15+
const srcPath = path.join(rollupDir, file);
16+
const destPath = path.join(destDir, file);
17+
18+
fs.copyFileSync(srcPath, destPath);
19+
console.log(`[Workaround] Copied ${srcPath} to ${destPath}`);
20+
21+
if (file === 'parseAst.d.ts') {
22+
const data = fs.readFileSync(destPath, 'utf8');
23+
const result = data.replace("from './rollup';", "from './';");
24+
fs.writeFileSync(destPath, result, 'utf8');
25+
console.log(`[Workaround] Updated import in ${destPath}`);
26+
}
27+
});

tsconfig.cjs.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"sourceMap": true,
66
"declarationMap": true,
77
"declaration": true,
8-
"rootDirs": ["lib"],
9-
"skipLibCheck": true
8+
"rootDirs": ["lib"]
109
},
1110
"include": [
1211
"lib/**/*.ts",

0 commit comments

Comments
 (0)