Javascript Web包的实际版本-ValidationError:样式加载器无效选项选项不应具有其他属性
为了不说太多不必要的信息,我将简要介绍。下面的代码工作正常。当我将Javascript Web包的实际版本-ValidationError:样式加载器无效选项选项不应具有其他属性,javascript,css,node.js,webpack,sass,Javascript,Css,Node.js,Webpack,Sass,为了不说太多不必要的信息,我将简要介绍。下面的代码工作正常。当我将'style-loader'更改为看似相等的代码(默认情况下它们相等){loader:'style-loader',options:{injectType:'styleTag'}}时,我收到此错误-验证错误:样式加载器无效选项选项不应具有其他属性 config.module.rules.push({ test: /\.scss$/, // Exclude files from these locations
'style-loader'
更改为看似相等的代码(默认情况下它们相等){loader:'style-loader',options:{injectType:'styleTag'}}
时,我收到此错误-验证错误:样式加载器无效选项选项不应具有其他属性
config.module.rules.push({
test: /\.scss$/,
// Exclude files from these locations
exclude: /node_modules|bower_components/,
include: [__dirname + "/src", defaultThemePaths.src],
// fallback: 'style-loader',
use: [
// Default style loader
'style-loader',
//reason we don't watch scss and css at the same time sass-loader see https://github.com/sass/node-sass/issues/2251
//SASS loader
// CSS loader
{
loader: "css-loader",
// Scepcify options for the CSS loader
options: {
// Root - must be specified in order to resolve URLs
// in css files and pick up on any images and fonts.
//root: paths.appSrc,
importLoaders: 2,
localIdentName: "[name]-[local]-[hash:base64:3]",
modules: true
}
},
{
loader: "sass-loader",
options: {
data: '@import "./src/styles/core";'
}
}
]
});
因此,我需要将injectType:'styleTag'
这是'style-loader'
行的默认值更改为injectType:'linkTag'