Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
"./dist/index.mjs"
],
"scripts": {
"build": "node --max-old-space-size=12288 node_modules/tsup/dist/cli-default.js",
"build": "node scripts/patch-tsup.mjs && node --max-old-space-size=12288 node_modules/tsup/dist/cli-default.js",
"dev": "node --max-old-space-size=12288 node_modules/tsup/dist/cli-default.js --watch",
"pre-release": "npm version prerelease --preid=alpha --no-git-tag-version && node scripts/sync-version.mjs && npm publish --access public --tag alpha",
"pre-release:create-lousho": "npm version prerelease --preid=alpha --no-git-tag-version -w create-lousho && npm run build -w create-lousho && npm publish -w create-lousho --access public --tag alpha",
Expand Down
10 changes: 10 additions & 0 deletions scripts/patch-tsup.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { readFileSync, writeFileSync } from 'node:fs';

const file = 'node_modules/tsup/dist/rollup.js';
const anchor = 'logCache("HIT", cacheKey);';
const fix = 'if (overrideConfigPath) dirName = path__namespace.dirname(path__namespace.resolve(process.cwd(), overrideConfigPath));';
const src = readFileSync(file, 'utf8');
if (!src.includes(fix)) {
if (!src.includes(anchor)) throw new Error(`patch-tsup: anchor not found in ${file}; tsup changed, re-check the dts cache bug`);
writeFileSync(file, src.replace(anchor, `${anchor}\n ${fix}`));
}
Loading