Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Import separator fix in Windows #59

Closed
wants to merge 4 commits into from
Closed
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
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@
"prebuild": "rimraf dist/*"
},
"dependencies": {
"compare-versions": "2.0.1",
"compare-versions": "2.0.2",
"object-assign": "^4.0.1",
"rollup-pluginutils": "^1.3.1",
"tippex": "^2.1.1",
"typescript": "^1.8.9"
"rollup-pluginutils": "^1.5.1",
"tippex": "^2.2.0",
"typescript": "^1.8.10"
},
"devDependencies": {
"mocha": "^2.3.3",
"mocha": "^3.0.0",
"rimraf": "^2.5.4",
"rollup": "^0.25.7",
"rollup-plugin-typescript": "^0.5.0"
"rollup": "^0.34.3",
"rollup-plugin-typescript": "^0.7.7"
},
"repository": {
"type": "git",
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ export default function typescript ( options: Options ) {
}

if ( !importer ) return null;

if (path.sep !== "/") {
importer = importer.split(path.sep).join("/");
}

var result: ts.ResolvedModuleWithFailedLookupLocations;

Expand Down Expand Up @@ -208,7 +212,7 @@ export default function typescript ( options: Options ) {
});

if ( fatalError ) {
throw new Error( `There were TypeScript errors transpiling "${id}"` );
throw new Error( `There were TypeScript errors.` );
}

return {
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe( 'rollup-plugin-typescript', function () {

it( 'reports diagnostics and throws if errors occur during transpilation', function () {
return bundle( 'sample/syntax-error/missing-type.ts' ).catch( function ( error ) {
assert.ok( error.message.indexOf( 'There were TypeScript errors' ) === 0, 'Should reject erroneous code.' );
assert.ok( error.message.search( 'Error transforming') === 0 && error.message.search('There were TypeScript errors.' ) > -1, 'Should reject erroneous code.' );
});
});

Expand Down