Webpack 5 Bootstrap sass long build-time

Viewed 88

In my Sass files I'm importing only the necessary Bootstrap components as described in the docs. But build time still takes about 3-6 seconds when using the watch option. This is very frustrating when working with Sass and making changes every time.

Is there a way to exclude Bootstrap from 're-compiling' every time I save? Because there's usually nothing changed to the root files of Bootstrap, only to my files. What could be a good method when working with Sass and Bootstrap while developing?

const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = ({
 mode: "development",

plugins: [new MiniCssExtractPlugin()],

module: {
    rules: [{
        test: /\.scss$/i,
        include: path.resolve(__dirname, 'src'),
        use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader", "postcss-loader"],
    }, ]
  }
});
0 Answers
Related