Skip to content

Commit cd779cd

Browse files
committed
fix([email protected]): fix to handle missing lib option under typescript > 2.6.1
1 parent eaff409 commit cd779cd

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

lib/plugin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ System.register(["typescript"], function (exports_1, context_1) {
393393
return this.getDefaultLibFilePaths(options)[0];
394394
};
395395
CompilerHost.prototype.getDefaultLibFilePaths = function (options) {
396-
return options.lib.map(function (libName) { return "typescript/lib/lib." + libName + ".d.ts"; });
396+
return options.lib ? options.lib.map(function (libName) { return "typescript/lib/lib." + libName + ".d.ts"; }) : ['typescript/lib/lib.d.ts'];
397397
};
398398
CompilerHost.prototype.useCaseSensitiveFileNames = function () {
399399
return false;

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plugin-typescript",
3-
"version": "7.1.0",
3+
"version": "7.1.1",
44
"description": "TypeScript loader for SystemJS",
55
"main": "lib/plugin.js",
66
"homepage": "https://github.com/frankwallis/plugin-typescript",
@@ -46,14 +46,16 @@
4646
"sinon": "^3.2.0",
4747
"ts-node": "^3.0.0",
4848
"tslib": "^1.4.0",
49-
"typescript": "^2.4.0"
49+
"typescript": "^2.6.1"
5050
},
5151
"scripts": {
5252
"bundle": "tsc && rollup -c && tsc ./tmp/plugin.js -m system -lib es6 -allowJs -allowUnreachableCode -removeComments -outDir ./lib",
5353
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
5454
"test": "mocha --require ./test/environment --timeout 10000 ./test/*.ts"
5555
},
56-
"files": ["lib/plugin.js"],
56+
"files": [
57+
"lib/plugin.js"
58+
],
5759
"bin": {},
5860
"license": "MIT",
5961
"jspm": {

src/compiler-host.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class CompilerHost implements ts.CompilerHost {
2727
}
2828

2929
public getDefaultLibFilePaths(options: ts.CompilerOptions): string[] {
30-
return options.lib.map(libName => `typescript/lib/lib.${libName}.d.ts`)
30+
return options.lib ? options.lib.map(libName => `typescript/lib/lib.${libName}.d.ts`) : ['typescript/lib/lib.d.ts'];
3131
}
3232

3333
public useCaseSensitiveFileNames(): boolean {

test/builder-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ describe('Builder', () => {
252252
config.typescriptOptions.target = "es5"
253253
builder.config(config)
254254
const result = await builder.buildStatic('testsrc', {})
255-
console.log(result.source)
255+
//console.log(result.source)
256256
result.source.should.contain('_context.import(\'')
257257
})
258258
})

0 commit comments

Comments
 (0)