From efc9046824a7370dfdbfd010e6236e1f0bf610cf Mon Sep 17 00:00:00 2001 From: Phuoc Nguyen Date: Mon, 25 Nov 2019 00:29:05 +0700 Subject: [PATCH] Fix the build to make @loadable work --- tsconfig.json | 5 +++-- webpack.config.js | 9 +++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 36e6fba..495fd53 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,8 +4,9 @@ "esModuleInterop": true, "sourceMap": true, "noImplicitAny": true, - "module": "commonjs", - "target": "es6", + "module": "esnext", + "moduleResolution": "node", + "target": "esnext", "jsx": "react" } } diff --git a/webpack.config.js b/webpack.config.js index c808016..ebf3654 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -26,11 +26,6 @@ module.exports = { }, module: { rules: [ - { - test: /\.jsx?$/, - exclude: /node_modules/, - loader: 'babel-loader', - }, { test: /\.css$/, use: ['style-loader', 'css-loader'], @@ -38,7 +33,9 @@ module.exports = { { test: /\.ts(x?)$/, exclude: /node_modules/, - use: 'ts-loader', + // The order of loaders are very important + // It will make the @loadable/component work + use: ['babel-loader', 'ts-loader'], }, { enforce: "pre",