diff options
-rw-r--r-- | tsconfig.json | 31 | ||||
-rw-r--r-- | webpack.config.js | 14 |
2 files changed, 40 insertions, 5 deletions
diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..bf03cd2 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "target": "es2017", + "module": "commonjs", + "allowJs": true, + "checkJs": true, + "jsx": "react", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./build", + "removeComments": true, + "importHelpers": true, + + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "strictBindCallApply": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "alwaysStrict": true, + + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + + "moduleResolution": "node", + "esModuleInterop": true + } +} diff --git a/webpack.config.js b/webpack.config.js index d9c60cc..a845375 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,12 +20,16 @@ config = { module: { rules: [ { - test: [ /\.js$/, /\.jsx$/ ], + test: [ /\.js$/, /\.jsx$/, /\.ts$/, /\.tsx$/], exclude: /node_modules/, loader: 'babel-loader', - query: { - presets: ['@babel/react'] - } + options: { + presets: [ + { plugins: ['@babel/plugin-proposal-class-properties'] }, + '@babel/react', + '@babel/preset-typescript' + ] + }, }, { test: /\.css$/, @@ -39,7 +43,7 @@ config = { }, resolve: { - extensions: [ '.js', '.jsx' ], + extensions: [ '.js', '.jsx', '.ts', '.tsx' ], modules: [path.join(__dirname, 'src'), 'node_modules'] }, |