Skip to content

Commit

Permalink
Posix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
NotWoods committed Feb 20, 2020
1 parent 86c80f0 commit beb6279
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function typescript(options: RollupTypescriptOptions = {}): Plugi
if (code) {
this.emitFile({
type: 'asset',
fileName: path.relative(outputOptions.dir!, id),
fileName: path.posix.relative(outputOptions.dir!, id),
source: code
});
}
Expand All @@ -99,7 +99,7 @@ export default function typescript(options: RollupTypescriptOptions = {}): Plugi
if (tsBuildInfoPath) {
this.emitFile({
type: 'asset',
fileName: path.relative(outputOptions.dir!, tsBuildInfoPath),
fileName: path.posix.relative(outputOptions.dir!, tsBuildInfoPath),
source: emittedFiles.get(tsBuildInfoPath)
});
}
Expand Down
4 changes: 2 additions & 2 deletions packages/typescript/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test('supports creating declaration files', async (t) => {
['main.js', 'main.d.ts']
);

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

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

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

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

0 comments on commit beb6279

Please sign in to comment.