-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
properly test local ts integration (#252)
- Loading branch information
1 parent
ac9a136
commit e121cd4
Showing
5 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
module.exports = require("typescript"); | ||
|
||
const { Module } = require('module'); | ||
const m = new Module('', null); | ||
m.paths = Module._nodeModulePaths(process.env.TYPESCRIPT_LOOKUP_PATH || (process.cwd() + '/')); | ||
let typescript; | ||
try { | ||
typescript = m.require('typescript'); | ||
console.log("ncc: Using typescript@" + typescript.version + " (local user-provided)"); | ||
} | ||
catch (e) { | ||
typescript = require('typescript'); | ||
console.log("ncc: Using typescript@" + typescript.version + " (ncc built-in)"); | ||
} | ||
module.exports = typescript; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var p: boolean = false; | ||
console.log(p); |