我正在尝试在包含SASS的现有项目中实现Webpack。
所以这是我的<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="ico-selector">
<div class="left-arrow">
<a href=""><i class="fa fa-chevron-left"></i></a>
</div>
<div class="icon">
<img src="https://d1j8pt39hxlh3d.cloudfront.net/development/emojione/2.2/843/2270.svg" />
<p>My Icon</p>
</div>
<div class="right-arrow">
<a href=""><i class="fa fa-chevron-right"></i></a>
</div>
</div>
webpack.config.js
但是,当我运行module.exports = {
entry: "./entry.js",
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
},
{
test: /\.css$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" },
{ loader: "sass-loader" }
]
}
]
},
resolve: {
extensions: ['*', '.js', '.jsx'],
},
};
时,我有这个错误
webpack
我不知道为什么。我发现的每个解决方案都是因为ERROR in ./style.scss
Module parse failed: Unexpected character '#' (1:8)
You may need an appropriate loader to handle this file type.
| $color: #bebebe;
|
| body {
@ ./entry.js 3:13-36
丢失了。但是,不是我的情况。