From 2490f00d08167f85ea5bebb7fb1fa2b88e7a4fe2 Mon Sep 17 00:00:00 2001 From: Tobias Golbs Date: Sun, 26 Aug 2018 22:29:33 +0200 Subject: [PATCH] Add .ts / .tsx to resolvable extensions To allow .ts and .tsx files webpack.config.js must be updated with resolve.extensions parameter This will ensure, that .ts and .tsx extensions must not be explicitly added in relative imports --- examples/typescript/pages/webpack.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/typescript/pages/webpack.config.js b/examples/typescript/pages/webpack.config.js index 2428c9d..1c6de03 100644 --- a/examples/typescript/pages/webpack.config.js +++ b/examples/typescript/pages/webpack.config.js @@ -2,6 +2,9 @@ * It is necessary to add the ts-loader for .tsx files */ module.exports = { + resolve: { + extensions: [".js", "md", "mdx", "jsx", ".ts", ".tsx"], + }, module: { rules: [ { test: /\.tsx?$/, loader: "ts-loader" }