enable typescript for webpack

This commit is contained in:
Val Erastov (xibyte) 2020-05-06 01:26:07 -07:00
parent 5a56478aec
commit 248dc5b10b
5 changed files with 25 additions and 9 deletions

View file

@ -1,7 +1,10 @@
{
"presets": ["@babel/env", "@babel/react", "@babel/flow"],
"presets": ["@babel/typescript", "@babel/env", "@babel/react", "@babel/flow"],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/proposal-class-properties"
"@babel/proposal-class-properties",
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining"
]
}

5
package-lock.json generated
View file

@ -4082,11 +4082,6 @@
"integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==",
"dev": true
},
"diff-match-patch": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.0.tgz",
"integrity": "sha1-HMPIOkkNZ/ldkeOfatHy4Ia2MEg="
},
"diffie-hellman": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",

View file

@ -67,6 +67,7 @@
"less": "^3.11.1",
"libtess": "1.2.2",
"lodash": "^4.17.15",
"marked": "^1.0.0",
"mousetrap": "1.6.1",
"numeric": "1.2.6",
"prop-types": "15.6.0",

17
tsconfig.json Normal file
View file

@ -0,0 +1,17 @@
{
"compilerOptions": {
"lib": ["es2018", "dom"],
"sourceMap": true,
"jsx": "react",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"target": "ES5",
"baseUrl": ".",
"paths": {
"*": [
"modules/*",
"node_modules/*"
]
}
}
}

View file

@ -29,7 +29,7 @@ module.exports = {
new webpack.HotModuleReplacementPlugin(),
],
resolve: {
extensions: ['.js', '.jsx'],
extensions: ['.js', '.jsx', ".ts", ".tsx"],
modules: [MODULES, "node_modules"]
},
devServer: {
@ -48,7 +48,7 @@ module.exports = {
},
module: {
rules: [{
test: /\.(js|jsx)$/,
test: /\.(js|jsx|ts|tsx)$/,
loader: 'babel-loader',
include: [MODULES, WEB_APP, INTEGRATION_TESTS]
}, {