Last active
July 11, 2017 05:41
-
-
Save jasonrm/4a88de5bfe0a749ddbc7dc60a57907fe to your computer and use it in GitHub Desktop.
Use typescript instead of typescript-simple with RiotJS
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
var typescriptConfig = require('./tsconfig.json'); | |
var typescript = require('typescript'); | |
var riot = require('riot'); | |
// Override typescript compiler | |
newTypescriptCompiler = function (js) { | |
return typescript.transpile(js, typescriptConfig); | |
}; | |
defaultReq = riot.parsers._req; | |
riot.parsers._req = (name) => { | |
if (name === 'js.typescript') { | |
return newTypescriptCompiler; | |
} | |
return defaultReq(name); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @jasonrm
Could you explain how to use this please?
Pascal