less-json-import-loader
v0.2.0
Published
load variable from json sources to Less files Edit
Downloads
11
Readme
npm install --save-dev less-json-import-loader
prefix
:string
, defualtjson-import
lessVariable
:boolean
, defualttrue
cssVariable
:boolean
, defualttrue
hash
:boolean
, defualtfalse
// webpack.config.js
{
module: {
rules: [
{ test: /\.less$/, use: [ "less-loader", "less-json-import-loader" ] }
]
}
}
before:
// a.less
@json-import "./test.json";
background: #222;
// test.json
{
"a": "#123456"
}
after
@a-md5: 1;
:root {
--a-md5: 1;
}
background: #222;
md5
: it is the value of md5('path/to/test.json')