Babel configuration for TypeScript

This commit is contained in:
Jason Miller
2020-08-12 18:19:46 -04:00
parent 1da9e9d7db
commit 46785491f0
4 changed files with 34 additions and 3 deletions

32
.babelrc Normal file
View File

@@ -0,0 +1,32 @@
{
"presets": [
[
"@babel/preset-typescript",
{
"jsxPragma": "h"
}
]
],
"plugins": [
[
"@babel/plugin-transform-react-jsx",
{
"loose": true,
"pragma": "h",
"pragmaFrag": "Fragment"
}
],
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
]
]
}

3
global.d.ts vendored
View File

@@ -1,6 +1,3 @@
declare const __webpack_public_path__: string;
declare const PRERENDER: boolean;
declare interface NodeModule {
hot: any;
}

View File

@@ -15,6 +15,7 @@
"pre-commit": "npm run lint"
}
},
"browserslist": ">0.25%, not IE 11, not op_mini all",
"postcss": {
"modules": true,
"plugins": {

View File

@@ -6,6 +6,7 @@
"module": "esnext",
"moduleResolution": "node",
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"noUnusedLocals": true,
"sourceMap": true,
"jsx": "react",