Skip to content

Instantly share code, notes, and snippets.

@jasonrm
Last active July 11, 2017 05:41
Show Gist options
  • Save jasonrm/4a88de5bfe0a749ddbc7dc60a57907fe to your computer and use it in GitHub Desktop.
Save jasonrm/4a88de5bfe0a749ddbc7dc60a57907fe to your computer and use it in GitHub Desktop.
Use typescript instead of typescript-simple with RiotJS
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);
};
@PascalLeMerrer
Copy link

Hi @jasonrm
Could you explain how to use this please?

Pascal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment