css-loader 的参数为什么加上报错
为什么我的在css-loader后面加上参数就会报错呢 {test: /\.css$/,use: [ 'style-loader','css-loader?importLoaders=1', { loader: 'postcss-loader', options: { plugins: function () { return [ require('autoprefixer') ]; } }} ] }
为什么我的在css-loader后面加上参数就会报错呢 {test: /\.css$/,use: [ 'style-loader','css-loader?importLoaders=1', { loader: 'postcss-loader', options: { plugins: function () { return [ require('autoprefixer') ]; } }} ] }
2017-03-20
rules: [
{
test: /\.js$/,
include: path.resolve(__dirname,'src'),
exclude: path.resolve(__dirname,'node_modules'),
loader: "babel-loader"
},
{
test: /\.css$/,
use: [
'style-loader', {
loader: 'css-loader',
options: {
// modules: true // 设置css模块化,详情参考https://github.com/css-modules/css-modules
}
}, {
loader: 'postcss-loader',
// 在这里进行配置,也可以在postcss.config.js中进行配置,详情参考https://github.com/postcss/postcss-loader
options: {
plugins: function() {
return [
require('precss'),
require('autoprefixer')
];
}
}
}
]
}
,{
test: /\.less$/,
use: [
'style-loader', 'css-loader', {
loader: "postcss-loader",
options: {
plugins: function() {
return [
require('autoprefixer')
];
}
}
}, 'less-loader'
]
}
]
举报