Last active
August 29, 2015 14:13
-
-
Save ksheedlo/674adb24154029e42c74 to your computer and use it in GitHub Desktop.
Typescript-require relative paths bug
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
$ node explode.js | |
fs.js:427 | |
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); | |
^ | |
Error: ENOENT, no such file or directory '/Users/ken/typescript-require-min-bug/tmp/tsreq/ship.js' | |
at Object.fs.openSync (fs.js:427:18) | |
at Object.fs.readFileSync (fs.js:284:15) | |
at runJS (/Users/ken/typescript-require-min-bug/node_modules/typescript-require/index.js:91:20) | |
at Object.require.extensions..ts (/Users/ken/typescript-require-min-bug/node_modules/typescript-require/index.js:22:3) | |
at Module.load (module.js:356:32) | |
at Function.Module._load (module.js:312:12) | |
at Module.require (module.js:364:17) | |
at require (module.js:380:17) | |
at Object.<anonymous> (/Users/ken/typescript-require-min-bug/test.js:5:1) | |
at Module._compile (module.js:456:26) |
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
require('typescript-require'); | |
var path = require('path'); | |
require(path.join(process.cwd(), 'test/ship.ts')); |
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
interface Kraken { | |
sink(vessel: any): void | |
} | |
var danger: Kraken = { | |
sink: (vessel) => { | |
vessel.sunk = true; | |
} | |
}; | |
export = danger; |
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
///<reference path="../src/ship.ts"/> | |
interface Ship { | |
sunk: Boolean | |
} | |
var failboat: Ship = { sunk: true }; | |
export = failboat; |
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
$ tree | |
. | |
|____tsreq | |
| |____src | |
| | |____ship.js | |
| |____test | |
| | |____ship.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment