How to reduce reboot time when using modifiers

I am currently using less-loader along with modifyVarsto overwrite several smaller variables to customize the style.

in my webpack.config.js

import theme from './theme.js';

{
        test: /\.(css|less)$/,
        loaders: ['style', 'css?sourceMap', 'postcss', `less-loader?{"sourceMap":true,"modifyVars":${JSON.stringify(theme)}}`],
      },

but for every change in theme.js I need to restart the server (running npm run), is there a way to do this automatically, as if I changed the smaller file and it will be replaced immediately?

theme.js

module.exports = {
  '@primary-color': '#1DA57A',
  '@font-size-base': '14px',
  '@btn-font-weight': '200',
};
+4
source share

Source: https://habr.com/ru/post/1667163/


All Articles