ts-node suggests to use require('ts-node/register'). And this can be seen in angular2-webpack-starter Protractor configuration.
What is require('ts-node/register') supposed to do? Does it patch require to transpile TS files, so a part of Node.js application could be written in TypeScript?
It does what you think it does. require('ts-node/register') is actually the same as:
require('./').register({
lazy: true
})
See examples here: https://github.com/TypeStrong/ts-node/tree/master/register
The .register function registers the Typescript compiler for files with .ts and .tsx extension for compilation on the fly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With