Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix prebundle script on Windows #18365

Merged
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
6 changes: 1 addition & 5 deletions scripts/bundle-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ async function dts({ input, externals, cwd, ...options }: Options) {

// await fs.remove(path.join(cwd, 'dist/ts-tmp'));

await execa('node', [
path.join(__dirname, '../node_modules/.bin/downlevel-dts'),
'dist/ts3.9',
'dist/ts3.4',
]);
await execa.command('yarn run -T downlevel-dts dist/ts3.9 dist/ts3.4');
}
}

Expand Down
5 changes: 3 additions & 2 deletions scripts/dts-localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import path from 'path';
import fs from 'fs-extra';
import { sync } from 'read-pkg-up';
import slash from 'slash';

import * as ts from 'typescript';

Expand Down Expand Up @@ -81,7 +82,7 @@ export const run = async (entrySourceFiles: string[], outputPath: string, option
const replaceRemapping = new Map<string, string[]>();

entrySourceFiles.forEach((file) => {
const sourceFile = sourceFiles.find((f) => f.fileName === file);
const sourceFile = sourceFiles.find((f) => f.fileName === slash(file));

actOnSourceFile(sourceFile);
});
Expand All @@ -103,7 +104,7 @@ export const run = async (entrySourceFiles: string[], outputPath: string, option
../../node_modules/packagename/node_modules/b/dist/dir/file.ts => _modules/packagename-node_modules-b-dist-dir-file.ts
./node_modules/packagename/dist/dir/file.ts => _modules/packagename-dist-dir-file.ts
./dist/ts-tmp/file.ts => file.ts

*/

if (relative.includes('node_modules/')) {
Expand Down