Answer the question
In order to leave comments, you need to log in
Why doesn't webpack update scss code after build?
Why doesn't webpack update scss code after build?
webpack.config.js:
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
mode: "production",
entry: {
home: "./src/assets/js/pages/home/home.js",
projects: "./src/assets/js/pages/projects/projects.js"
},
output: {
path: path.resolve(__dirname, "./dist"),
filename: "[name].js",
publicPath: "/dist"
},
module: {
rules: [{
test: /\.js$/,
loader: "babel-loader",
exclude: "/node_modules/"
}, {
test: /\.scss$/,
use: [
"style-loader",
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
options: { sourceMap: true }
},
{
loader: "postcss-loader",
options: { sourceMap: true, config: { path: 'src/assets/js/postcss.config.js' } }
},
{
loader: "sass-loader",
options: { sourceMap: true }
}
]
}]
},
plugins: [
new MiniCssExtractPlugin({
filename: "styles.css"
})
],
devServer: {
port: 5500,
}
}
npm run build
, then nothing will change in the bundle, although it writes what I compiled styles.scss
into styles.css
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question