less-import-once
v1.1.4
Published
Webpack loader to removes duplicated LESS imports marked as (once)
Downloads
5
Readme
less-import-once
Webpack loader to removes duplicated LESS imports marked as (once).
Installation
npm install --save-dev less-import-once
or
yarn add --dev less-import-once
or
pnpm install --save-dev less-import-once
Usage
// webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.less$/,
use: [
'style-loader',
'css-loader',
'less-loader',
'less-import-once',
],
},
],
},
};
/* Button.less */
@import (once) 'Input.less';
@import (once) url("Input.less");
.Button {
border: solid;
}
/* Checkbox.less */
@import (once) url(Input.less);
.Checkbox {
cursor: pointer;
}
Output
/* Button.less */
@import (once) 'Input.less';
.Button {
border: solid;
}
/* Checkbox.less */
.Checkbox {
cursor: pointer;
}