jsontosass-loader icon indicating copy to clipboard operation
jsontosass-loader copied to clipboard

Update to allow for a js vars file

Open EdwardIrby opened this issue 9 years ago • 2 comments

Need to add a feature that allows the use of a var file that is a .js file like below

 modules.exports={
   "variable-1":"50px"
   "variable-map":{
       "sub-variable-1":"20px"
   }
}

EdwardIrby avatar Jan 07 '16 19:01 EdwardIrby

Hi,

I agree and I had the same issue. I forked this repo to handle the loader differently :

https://github.com/loick/jsontosass-loader

1 - You export the config in your webpack file (basically the JSON) 2 - Then you add the JSON in parameter instead of the file

  • More flexible since we can use the conf everywhere with the export
  • Less dependencies on the plugin

Do you want a PR ?

loick avatar Mar 03 '16 14:03 loick

I like the work. In fact a earlier version worked like that. I changed it because I designed the tool to be used when writing scss and js, webpack in watch or the dev server mode. I found when I don't addDependency when var file changes the dev server or watch is not triggered to reload. When I'm writing styles that's rather annoying. I just need to take the time to fix this. I stopped using SASS so I've honestly left this on the back burner.

EdwardIrby avatar Mar 03 '16 18:03 EdwardIrby