1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

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>
This commit is contained in:
Hung-Han (Henry) Chen 2020-12-03 17:14:46 +08:00
parent 78400e51fc
commit 02b4703c34
No known key found for this signature in database
GPG Key ID: A28B7834EFA73792

View File

@ -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 <https://github.com/handlebars-lang/handlebars.js/issues/953#issuecomment-239874313>
alias: {
"handlebars": "handlebars/dist/handlebars.js"
}
},
plugins: [
// In ts-loader's README they said to output a built .d.ts file,