Skip to content

Commit beb6279

Browse files
committed
Posix paths
1 parent 86c80f0 commit beb6279

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/typescript/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default function typescript(options: RollupTypescriptOptions = {}): Plugi
8989
if (code) {
9090
this.emitFile({
9191
type: 'asset',
92-
fileName: path.relative(outputOptions.dir!, id),
92+
fileName: path.posix.relative(outputOptions.dir!, id),
9393
source: code
9494
});
9595
}
@@ -99,7 +99,7 @@ export default function typescript(options: RollupTypescriptOptions = {}): Plugi
9999
if (tsBuildInfoPath) {
100100
this.emitFile({
101101
type: 'asset',
102-
fileName: path.relative(outputOptions.dir!, tsBuildInfoPath),
102+
fileName: path.posix.relative(outputOptions.dir!, tsBuildInfoPath),
103103
source: emittedFiles.get(tsBuildInfoPath)
104104
});
105105
}

packages/typescript/test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test('supports creating declaration files', async (t) => {
5454
['main.js', 'main.d.ts']
5555
);
5656

57-
t.is(output[1].source, 'declare const answer = 42;\n');
57+
t.true(output[1].source.includes('declare const answer = 42;'), output[1].source);
5858
});
5959

6060
test('supports creating declaration files in subfolder', async (t) => {
@@ -197,7 +197,7 @@ test('relative paths in tsconfig.json are resolved relative to the file', async
197197
['main.js', 'main.d.ts']
198198
);
199199

200-
t.is(output[1].source, 'declare const answer = 42;\n');
200+
t.true(output[1].source.includes('declare const answer = 42;'), output[1].source);
201201
});
202202

203203
test('throws for unsupported module types', async (t) => {

0 commit comments

Comments
 (0)