1.2.0 • Published 3 years ago
build-tools-webpack-less v1.2.0
build-tools-webpack-less
Set of tools and utilities to work with webpack and Less.
Install
npm install --save-dev build-tools-webpack-less
Usage
In webpack.config.js
:
const { rules: lessRules } = require('build-tools-webpack-less');
module.exports = {
module: {
rules: [
...lessRules,
... // other loaders
]
}
};
To allow extraction of CSS in production, set NODE_ENV=production
and adjust webpack.config.js
:
const {
rules: lessRules,
plugin: lessExtractPlugin
} = require('build-tools-webpack-less/extract');
module.exports = {
module: {
rules: [
...lessRules,
... // other loaders
]
},
plugins: [
lessExtractPlugin
]
};