It's no longer allowed to omit the '-loader' suffix when using loaders.解决办法

2021-07-09 10:56:44 浏览数 (1)

代码语言:javascript复制
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.
                 You need to specify 'style-loader' instead of 'style',
                 see https://webpack.js.org/guides/migrating/#automatic-loader-module-name-extension-removed

Webpack新版本要求配置module中的loader不能缩写,也就是loader:"style-loader"中的-loader必须要写

类似的还有loaders:['babel-loader','css-loader','sass-loader']坑惨我了

0 人点赞