Configure webpack and tsconfig

jh-changes
Shin'ya Ueoka 6 years ago
parent fa0325bb8a
commit 71f3a1ea2d
  1. 2
      package.json
  2. 1
      tsconfig.json
  3. 16
      webpack.config.js

@ -6,7 +6,7 @@
"build": "NODE_ENV=production webpack --mode production --progress --display-error-details", "build": "NODE_ENV=production webpack --mode production --progress --display-error-details",
"package": "npm run build && script/package", "package": "npm run build && script/package",
"lint": "eslint --ext .js,.jsx,.ts,.tsx src", "lint": "eslint --ext .js,.jsx,.ts,.tsx src",
"type-checks": "tsc", "type-checks": "tsc --noEmit",
"test": "karma start", "test": "karma start",
"test:e2e": "mocha --timeout 8000 e2e" "test:e2e": "mocha --timeout 8000 e2e"
}, },

@ -5,7 +5,6 @@
"lib": ["es6", "dom", "es2017"], "lib": ["es6", "dom", "es2017"],
"allowJs": true, "allowJs": true,
"checkJs": true, "checkJs": true,
"noEmit": true,
"jsx": "react", "jsx": "react",
"sourceMap": true, "sourceMap": true,
"outDir": "./build", "outDir": "./build",

@ -20,21 +20,9 @@ config = {
module: { module: {
rules: [ rules: [
{ {
test: [ /\.js$/, /\.jsx$/, /\.ts$/, /\.tsx$/], test: [ /\.ts$/, /\.tsx$/],
exclude: /node_modules/, exclude: /node_modules/,
loader: 'babel-loader', loader: 'ts-loader'
options: {
presets: [
{
plugins: [
["@babel/plugin-proposal-decorators", { "legacy": true }],
'@babel/plugin-proposal-class-properties'
]
},
'@babel/react',
'@babel/preset-typescript'
]
},
}, },
{ {
test: /\.css$/, test: /\.css$/,