diff --git a/package.json b/package.json index 04ed076..96845b6 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.ts b/src/index.ts index a516022..3d44106 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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; @@ -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 { diff --git a/test/test.js b/test/test.js index aff2c87..9a3da9a 100644 --- a/test/test.js +++ b/test/test.js @@ -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.' ); }); });