Здравствуйте! Впервые пытаюсь применить sass. Настраиваю webpack:
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const path=require('path');
module.exports={
entry:'./src/index.js',
output:{
filename:'bundle.js',
path:path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
}
]
},
plugins: [
new ExtractTextPlugin('style.css')
],
resolve: {
extensions: ['.js', '.scss']
}
}
файлы scss и js лежат в одной папке (src).
scss подключен во входном index.js:
import './src/base.scss'
При запуске webpack получаю ошибку:
ERROR in ./src/base.scss 1:9
Module parse failed: Unexpected token (1:9)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See
https://webpack.js.org/concepts#loade
rs
> $bg-color: pink;
|
| body {
@ ./src/index.js 1:0-20