Skip to content

Commit

Permalink
Update release
Browse files Browse the repository at this point in the history
  • Loading branch information
ivogabe committed Jan 21, 2015
1 parent aedb88c commit fb36ee1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions release/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ var Host = (function () {
this.reset();
}
Host.initLibDefault = function () {
var content = fs.readFileSync(path.join(__dirname, '../typescript/lib.d.ts')).toString('utf8');
this.libDefault = ts.createSourceFile('__lib.d.ts', content, 0 /* ES3 */, "0"); // Will also work for ES5
var content = fs.readFileSync(path.join(__dirname, '../node_modules/typescript/bin/lib.d.ts')).toString('utf8');
this.libDefault = ts.createSourceFile('__lib.d.ts', content, 0 /* ES3 */, "0"); // Will also work for ES5 & 6
};
Host.prototype.reset = function () {
this.output = {};
Expand Down
10 changes: 9 additions & 1 deletion release/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ var langMap = {
};
var moduleMap = {
'commonjs': 1 /* CommonJS */,
'amd': 2 /* AMD */
'amd': 2 /* AMD */,
'none': 0 /* None */
};
function getCompilerOptions(settings) {
var tsSettings = {};
Expand All @@ -125,11 +126,18 @@ function getCompilerOptions(settings) {
tsSettings.target = langMap[(settings.target || 'es3').toLowerCase()];
}
if (tsSettings.target === undefined) {
// TS 1.4 has a bug that the target needs to be set.
// This block can be removed when a version that solves this bug is published.
// The bug is already fixed in the master of TypeScript
tsSettings.target = 0 /* ES3 */;
}
if (settings.module !== undefined) {
tsSettings.module = moduleMap[(settings.module || 'none').toLowerCase()];
}
if (tsSettings.module === undefined) {
// Same bug in TS 1.4 as previous comment.
tsSettings.module = 0 /* None */;
}
if (settings.sourceRoot === undefined) {
tsSettings.sourceRoot = process.cwd();
}
Expand Down

0 comments on commit fb36ee1

Please sign in to comment.