From 46785491f0bdbf8724693b80e75c86e2e18e2ba4 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Wed, 12 Aug 2020 18:19:46 -0400 Subject: [PATCH] Babel configuration for TypeScript --- .babelrc | 32 ++++++++++++++++++++++++++++++++ global.d.ts | 3 --- package.json | 1 + tsconfig.json | 1 + 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..e5656bd4 --- /dev/null +++ b/.babelrc @@ -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 + } + ] + ] +} diff --git a/global.d.ts b/global.d.ts index 0f8de726..b518c01f 100644 --- a/global.d.ts +++ b/global.d.ts @@ -1,6 +1,3 @@ -declare const __webpack_public_path__: string; -declare const PRERENDER: boolean; - declare interface NodeModule { hot: any; } diff --git a/package.json b/package.json index 57dd2a34..8e179e19 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "pre-commit": "npm run lint" } }, + "browserslist": ">0.25%, not IE 11, not op_mini all", "postcss": { "modules": true, "plugins": { diff --git a/tsconfig.json b/tsconfig.json index 9b77b843..82b2dec7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ "module": "esnext", "moduleResolution": "node", "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, "noUnusedLocals": true, "sourceMap": true, "jsx": "react",