IngwiePhoenix / sassport-loader

Use SassPort to render your Sass in WebPack!
MIT License
8 stars 2 forks source link

SASS vars from imported JS not updated on file change #1

Closed stevoland closed 8 years ago

stevoland commented 8 years ago

Hi, thanks for the project.

I'm importing JS files in my SASS which works great but when I'm updating the JS file, the SASS doesn't pick up on the changes. Webpack rebuilds as usual but nothing happens with webpack-dev-middleware and webpack-hot-middleware. Even if I reload the page the changes aren't picked up. I have to restart the Webpack build process.

Any ideas where to start looking into this? Thanks

EDIT: Some clarification, I have a config including:

    Sassport: {
        modules: [
          require('./src/theme/vars')
        ]
      }

And SASS:

$vars = require("src/theme/vars");

$color = map-get($vars, color);
IngwiePhoenix commented 8 years ago

Ahh, I see. I will have to see how I can tweak in this behaviour, but I know what to do. Thanks for the note, I’ll get back to you about this ASAP :)

stevoland commented 8 years ago

Thanks!

stevoland commented 8 years ago

Have you had any luck with this? I've tried myself and can get a rebuild triggered but the CSS output is the same until the webpack server is restarted.

IngwiePhoenix commented 8 years ago

Hey. As you can see in the issue mentioned between the posts, there is now an update to Sassport that will allow me to add a fix. Weekend is just starting here, so Ill be able to fix you an update soon. Please wait just a little longer :)

2015-11-26 16:13 GMT+01:00 Stephen J. Collings notifications@github.com:

Have you had any luck with this? I've tried myself and can get a rebuild triggered but the CSS output is the same until the webpack server is restarted.

— Reply to this email directly or view it on GitHub https://github.com/IngwiePhoenix/sassport-loader/issues/1#issuecomment-159935586 .

stevoland commented 8 years ago

Yes, I've tried to use the onRequire hook and I can get Webpack to rebuild but the output CSS doesn't change. Hopefully you'll have more luck!

IngwiePhoenix commented 8 years ago

Alright im going to give this a try now. Weekend turned up differently than expected and I got illstruck today. So im going to do that, now x)

IngwiePhoenix commented 8 years ago

Im fixing up an example inside the project to have something to showcase. But theoretically, this should work now. Ill let you know when i published a new version.

IngwiePhoenix commented 8 years ago

Done. 0.2.0 has it all now. :)

stevoland commented 8 years ago

Looks great, thanks so much. Busy today but will hopefully get a chance to test it out tomorrow.

stevoland commented 8 years ago

Works like a dream, thanks!