From 69aeb964ff3b20e897171f293c07ad345caeacac Mon Sep 17 00:00:00 2001 From: Tommi Komulainen Date: Thu, 29 Jun 2017 20:37:36 +0200 Subject: [PATCH] docs: add webpack customization example for typescript support Provides a copypastable starting point for a quick start and typescript for those who want it. --- docs/pages/configurations/custom-webpack-config/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/pages/configurations/custom-webpack-config/index.md b/docs/pages/configurations/custom-webpack-config/index.md index 589be4baee44..ffb6e9eb8878 100644 --- a/docs/pages/configurations/custom-webpack-config/index.md +++ b/docs/pages/configurations/custom-webpack-config/index.md @@ -105,6 +105,14 @@ module.exports = (baseConfig, env) => { // Extend it as you need. + // For example, add typescript loader: + config.module.rules.push({ + test: /\.(ts|tsx)$/, + include: path.resolve(__dirname, '../src'), + loader: require.resolve('ts-loader') + }); + config.resolve.extensions.push('.ts', '.tsx'); + return config; }; ```