News for hackers. Stuff that matters.
Re:Create React App 2.0: Babel 7, Sass, and More by sbr464 on Tuesday October 02, 2018 @03:46AM (#18119530)
Here were the changes to get typescript working with an existing node.js codebase (babel 7)

package.json (scripts)

  BABEL_ENV=development babel -d build/ src/ --extensions \".ts,.tsx,.js\" --quiet --source-maps inline
package.json (add property)

  "type-check": "tsc",
package.json (dev depenencies)

  @babel/preset-typescript, typescript
babelrc (add with env)

  presets: ["@babel/typescript"]
tsconfig (example)

  {
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "declaration": true,
    "outDir": "build",
    "strict": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "skipLibCheck": true
  }
}

There are no comments on this comment yet.