Webpack scss意外字符“ @”

时间:2018-11-10 20:13:38

标签: webpack sass

这是我的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,所以为什么会出现此错误?

0 个答案:

没有答案