webpack compilar o arquivo sass to css
const path = require('path');
const FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");
module.exports = {
entry: [
__dirname + '/src/js/app.js',
__dirname + '/src/scss/app.scss'
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'js/app.min.js',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [],
}, {
test: /\.scss$/,
exclude: /node_modules/,
type: 'asset/resource',
generator: {
filename: 'css/[name].min.css'
},
use: [
'sass-loader'
]
}
]
},
plugins: [
new FixStyleOnlyEntriesPlugin({ extensions:['scss'] }),
],
};
Vitalik-Hakim