这是我的webpack.config.js
const ExtractTextPlugin = require('extract-text-webpack-plugin');
rules:
{
test: /\.(sass|scss)$/,
include: path.resolve(__dirname, 'src/scss'),
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
}
plugins: [
new webpack.HotModuleReplacementPlugin(),
new ExtractTextPlugin({
filename: './dist/bundle.css',
}),
],
我得到了这个错误:
Module parse failed: Unexpected character '@' (4:0)
You may need an appropriate loader to handle this file type.
> @import 'base/grid';
在css-loader文档中,该文档翻译了@import,所以为什么会出现此错误?