diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..936ae30 --- /dev/null +++ b/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["@babel/env", "@babel/typescript"], + "plugins": ["@babel/plugin-transform-runtime", "@babel/plugin-syntax-dynamic-import"] +} diff --git a/README.md b/README.md index dbc6bca..69461da 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # preact-async-ts -Demo of preact AsyncRoute with TypeScript +Demo of preact AsyncRoute with TypeScript and Babel Let’s get started… diff --git a/package.json b/package.json index f2ad882..abaa91a 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,12 @@ "start": "http-server dist" }, "devDependencies": { + "@babel/core": "^7.2.0", + "@babel/plugin-transform-runtime": "^7.2.0", + "@babel/plugin-syntax-dynamic-import": "^7.2.0", + "@babel/preset-env": "^7.2.0", + "@babel/preset-typescript": "^7.1.0", + "babel-loader": "^8.0.4", "clean-webpack-plugin": "^0.1.19", "html-webpack-plugin": "^3.2.0", "http-server": "^0.11.1", diff --git a/webpack.config.js b/webpack.config.js index dd4a313..7dc407d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -21,7 +21,7 @@ module.exports = { { test: /\.tsx?$/, exclude: /node_modules/, - loader: 'ts-loader', + loaders: ['babel-loader', 'ts-loader' ], }, ], },