Skip to content

Destination CSS file is not updating using watchify #63

Closed

Description

@tinchoz49

Hi guys, working with your example: https://github.com/css-modules/browserify-demo
I ran into this problem: using watchify, the event emit 'update' works great but is not updating the dest css file.

run: npm start and edit a css file from the src folder.
The log gets info browserify: /index.js 682ms (bundle) but the dest css file is not changed.

Activity

  1. tinchoz49 commented on Nov 21, 2015

    @tinchoz49
    Author

    I found that if you comment the line 47 and 48 of the file-system-loader works.
    What is the objetive of create a token based on the filename? If is for caching I think is better create a checksum based on the content file.

  2. joshwnj commented on Nov 23, 2015

    @joshwnj
    Member

    Thanks for reporting this @tinchoz49 . It looks like a solution shouldn't be too tricky but there are a few different factors at play so we'll need to make sure other functionality isn't affected. Would you be interested in helping to put together a failing test case for this bug?

  3. justgook commented on Nov 25, 2015

    @justgook

    By commenting those lines it updates map, but not rebuild css-file

  4. markuplab commented on Nov 27, 2015

    @markuplab

    Do you need help with this problem? I can try make fixes.

  5. justgook commented on Nov 27, 2015

    @justgook

    for me it is main stopper to use css-modules in my projects..

  6. joshwnj commented on Nov 28, 2015

    @joshwnj
    Member

    Thanks for the offer @markuplab - that'd be great, especially if you're able to help with writing a test case for this issue.

  7. joshwnj commented on Nov 28, 2015

    @joshwnj
    Member

    Status on this: I'm looking into a better way of walking the dependency tree, which I'm hoping will be the key to getting watchify working properly. But my time is limited so if anyone else cares to help that would be greatly appreciated :)

  8. joshwnj commented on Nov 29, 2015

    @joshwnj
    Member

    From early trials the solution appears to be working 🙆‍♀️ Need to check a few more edges and then will put together a release.

  9. markuplab commented on Nov 29, 2015

    @markuplab

    Ohhh it's amazing :) Can you create PR?

  10. markuplab commented on Nov 30, 2015

    @markuplab

    @joshwnj Hi, can you say, when release with this fix will be ready? We want start project with css-modules, but watchify problem block it, if you have troubles with time, we can fork module and fix it problem, or we can wait when you fix it?

  11. joshwnj commented on Nov 30, 2015

    @joshwnj
    Member

    @markuplab I've pushed #64, which still has a couple of bugs and failing tests (and I believe will need css-modules/css-modules-loader-core#62 to be merged in order to pass as well).

    But even at this point it partly works :) And hopefully it gives you an idea of where it's heading, so please take a look and feel free to fix any bugs you see. I'm out of time today but hopefully will have time to wrap it up tomorrow.

  12. snikch commented on Nov 30, 2015

    @snikch

    @joshwnj I've been watching this issue, and have tried out #64 and this seems to fix the issue for me.

  13. snikch commented on Nov 30, 2015

    @snikch

    Hrm, I spoke too soon. It will handle a change which it hasn't seen before, but making a change then reverting it will not result in an update.

    For example, running with a padding: 10px, then changing to padding: 60px will correctly rebuild the css, but changing back to padding: 10px will not. Updating to a new value, such as padding: 600px, will trigger an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions