我正在从 webpack 1 迁移到 3。在经历了这么多错误之后,现在我陷入了困境。有人可以帮忙!
我收到这些错误 -
ERROR in ./src/main/main.scss
Module parse failed: Unexpected token (1:4)
You may need an appropriate loader to handle this file type.
| body{
| color: red;
| }
@ ./src/main/js/App.jsx 13:0-23
@ ./src/main/js/index.jsx
这是示例回购 - https://github.com/shivamkumar110/webpack-3-test
这是我的webpack.config.js的片段
module: {
rules: [
{
test: /\.jsx?$/,
use: ['eslint-loader'],
include: SRC,
enforce: 'pre'
}, {
test: /\.jsx?$/,
use: ['babel-loader'],
include: SRC
}, {
test: /(\.css|\.scss)$/,
include: SRC,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader:'css-loader',
options: {
sourceMap:true
}
},
{
loader: 'sass-loader',
options: {
sourceMap: true
}
}
]
})
},