webpack3.0加入@import之后importLoaders:1并没有作用还会报错
刚学webpack的配置,现在是webpack3.0.0,按照文档已经写了最新的方法还会会报错:
ERROR in ./node_modules/css-loader?{"modules":true,"importLoaders":1}!./node_mod
ules/postcss-loader/lib?{"plugins":[null]}!./src/css/main.css
Module not found: Error: Can't resolve 'flex.css' in 'D:\webpack-apps\src\css'
@ ./node_modules/css-loader?{"modules":true,"importLoaders":1}!./node_modules/p
ostcss-loader/lib?{"plugins":[null]}!./src/css/main.css 3:10-177
@ ./src/css/main.css
@ ./src/components/layer/layer.js
配置如下:
{
test:/\.css$/,
use: ['style-loader',{
loader:'css-loader',
options:{
modules: true,
importLoaders: 1
}
},{
loader:'postcss-loader',
options:{
plugins:[
require('autoprefixer')
]
}
}]
}