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; }; ```