Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change css file issue #36

Open
seeden opened this issue Feb 23, 2016 · 13 comments
Open

change css file issue #36

seeden opened this issue Feb 23, 2016 · 13 comments

Comments

@seeden
Copy link

seeden commented Feb 23, 2016

Hi

I have two files index.js and index.css (index.js requires index.css)
When I change index.css it will use old version.
I need to change index.js too if I want to get latest noncached index.css.
Anyway thank you for this great package :)

@istarkov
Copy link
Owner

Looks like I need to add BABEL_DISABLE_CACHE=1 into README.md (I use this env variable anywhere in package.json)
Thank you.

@seeden
Copy link
Author

seeden commented Feb 23, 2016

I am using it too but I was wondering if there is any other option.

@istarkov
Copy link
Owner

I'll look in babel sources. Looks like there is no other options in documentation. Any help will be appreciated.

@istarkov
Copy link
Owner

Looks like babel plugin babel-plugin-transform-inline-environment-variables must have the same issue if env variable has chaged. For now I'll add warning here, and will create an issue at babel, to get a good solution from babel community

@seeden
Copy link
Author

seeden commented Feb 23, 2016

Thank you @istarkov . It sounds good

@istarkov
Copy link
Owner

https://phabricator.babeljs.io/T1186 It is already where, will read when come 2 home.

istarkov added a commit that referenced this issue Feb 23, 2016
istarkov added a commit that referenced this issue Feb 23, 2016
@istarkov
Copy link
Owner

PR #37, now in npm version 0.3.6

@thangngoc89
Copy link

Ouch. That's why I get this warning

babel-plugin-webpack-loader:
To avoid caching errors you need to set BABEL_DISABLE_CACHE=1 environment variable.
More information at issue #36

@seeden
Copy link
Author

seeden commented Feb 23, 2016

I guess that they closed the ticket as resolved without any fix

@istarkov
Copy link
Owner

As plugins has no knowledge about caching, there is no way to pass additional cache key information about revalidation etc.
I've looked into code and cache cleared if BABEL_ENV, NODE_ENV variables and/or plugin options has changed. As I can't change this variables inside plugin, the only way now is to ask user to set BABEL_DISABLE_CACHE=1 or to set undocumented option cache=false.
As cache=false undocumented, the only way is to ask users to set BABEL_DISABLE_CACHE=1

And I have zero idea what I can suggest to babel to make cache revalidation algorithm smart.

@seeden
Copy link
Author

seeden commented Feb 26, 2016

Yep. I understand. The interesting thing is that the Webpack is working with the babel(without BABEL_DISABLE_CACHE). Maybe they are able to force the babel somehow.

@istarkov
Copy link
Owner

There is no need for webpack to re-transpile js files if something has changed in css file. Because it uses something like webpack_require for includes. But here css-module definition in placed inside js.

@marcustisater
Copy link

Thanks for the update guys 👍

The problem is that it slows down our build script, it's understandable because it's disabling the cache. If you have any other workarounds or follow up on this issue it would be very much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants