webpack 升级Getting error: configuration.resolve.extensions[0] should not be empty

季炯
2023-12-01

webpack 升级后,extensions 数组中不能使用空字符串,需要使用* 代替。
否则报错

Getting error: configuration.resolve.extensions[0] should not be empty 

参考文档:https://github.com/webpack/webpack/issues/3043

I am not sure that this is correct but after a series of trial an error I have tried using the * symbol instead of an empty string. This seems to have fixed the problem.So final syntax for the extensions attribute:

extensions: [‘*’, ‘js’, ‘ts’]

Hope this is the intended way to do it
�� 71 ❤️ 16

 类似资料: