From 02b4703c340fbffc43a63268e994225260cc79bc Mon Sep 17 00:00:00 2001 From: "Hung-Han (Henry) Chen" <1474479+chenhunghan@users.noreply.github.com> Date: Thu, 3 Dec 2020 17:14:46 +0800 Subject: [PATCH] Fix webpack warning require.extensions is not supported by webpack. Use a loader instead. Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com> --- webpack.extensions.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webpack.extensions.ts b/webpack.extensions.ts index 220f85a47a..f0c18547ee 100644 --- a/webpack.extensions.ts +++ b/webpack.extensions.ts @@ -101,7 +101,14 @@ export default function (): webpack.Configuration { ] }, resolve: { - extensions: [".ts", ".tsx", ".js"] + extensions: [".ts", ".tsx", ".js"], + // the alias is to avoid webpack warning + // "require.extensions is not supported by webpack. Use a loader instead." + // from ./src/extensions/cluster-feature.ts + // the trick is from + alias: { + "handlebars": "handlebars/dist/handlebars.js" + } }, plugins: [ // In ts-loader's README they said to output a built .d.ts file,