Home

Awesome

This is the minimal possible setup to get a in memory version of React Native working with TypeScript support. The current techniques use a multi-step process, you save -> TypeScript creates JS file -> Babel sees JS file and compiles to ES5. This replaces that with a custom transformer that will either pass the file to Babel or the TypeScript compiler.

If you want to see a non-trivial production version: https://github.com/artsy/emission

This repo is the techniques inside that app replicated against a new project.


Steps required to make this project:

{
  "compilerOptions": {
    "target": "es5",  
    "module": "commonjs",
    "jsx": "react", 
    "strict": true  
  }
}
module.exports = {
  getSourceExts() {
    return ["js", "ts", "tsx"]
  },

  getTransformModulePath() {
    return require.resolve("./transformer")
  },
}

Making it feel good: