- Flagged as cacheable
- Simpler implementation (See Example Config)
- Marked dependencies (triggers build on webpack watch and webpack-dev-server when vars file is changed)
npm install jsontosass-loader --save-dev
var sassVars = 'path/to/your/vars.json';
var webpackConfig = {
module: {
loaders:[
{test: /.scss$/, loader: "style!css!sass!jsontosass?path="+ sassVars}
]
},
}
Input [YourVars.json file]
{
"breakpoints":{
"portraitS": "320px",
"portraitM": "360px",
"portraitL": "414px",
},
"localNavHeight":"50px",
}
Output SCSS
$breakpoints:(portraitS:320px,portraitM:360px,portraitL:414px);
$localNavHeight:50px;
Forked from gist: jsonToSassVars and prepend-loader