Skip to content

Destination CSS file is not updating using watchify #63

@tinchoz49

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

tinchoz49

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.

joshwnj

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?

justgook

justgook commented on Nov 25, 2015

@justgook

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

markuplab

markuplab commented on Nov 27, 2015

@markuplab

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

justgook

justgook commented on Nov 27, 2015

@justgook

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

joshwnj

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.

joshwnj

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 :)

joshwnj

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.

markuplab

markuplab commented on Nov 29, 2015

@markuplab

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

markuplab

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?

joshwnj

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.

snikch

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.

snikch

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

        Participants

        @joshwnj@snikch@justgook@tinchoz49@markuplab

        Issue actions

          Destination CSS file is not updating using watchify · Issue #63 · css-modules/css-modulesify