Skip to content

Commit

Permalink
Merge pull request #18365 from joshwooding/fix-prebundle-script-on-wi…
Browse files Browse the repository at this point in the history
…ndows

Fix prebundle script on Windows
  • Loading branch information
ndelangen committed Jun 7, 2022
2 parents c8a3b7b + 482676f commit 37d48a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions scripts/bundle-package.ts
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
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

0 comments on commit 37d48a3

Please sign in to comment.