我目前正在更新我的nodejs包和更新的webpack到3.5.5,並且構建現在無法嘗試加載css和sass。這是我的裝載機的外觀。Webpack 3.5.5錯誤加載CSS和SASS
loaders: [
{test: /\.jsx?$/, exclude: /node_modules/, loaders: ['babel-loader']},
{test: /\.(eot|woff|woff2|svg|ttf)([\?]?.*)$/, loader: "file-loader" },
{test: /\.(jpe?g|png|gif)$/i, loader: 'file?name=[name].[ext]-loader'},
{test: /\.ico$/, loader: 'file?name=[name].[ext]-loader'},
{test: /(\.css|\.scss)$/, loaders: ['style-loader', 'css?sourceMap-loader', 'postcss-loader', 'sass?sourceMap-loader']},
]
我想知道如果我需要改變任何東西,這些裝載機將工作? 我得到的錯誤是
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders. You need to specify 'css-loader' instead of 'css', see webpack.js.org/guides/migrating/… `
運行'webpack'時輸出/錯誤信息是什麼? –
突破性改變:使用裝載機時,不再允許省略'-loader'後綴。 您需要指定'css-loader'而不是'css', 請參閱https://webpack.js.org/guides/migrating/#automatic-loader-module-name-extension-removed – Totals
因此,如果您有' css?sourceMap-loader',請嘗試改用'css-loader?sourceMap'。 –