Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently when running css-modulesify first time passed postcss plugins are cached in loader and the subsequent runs in the same process but with different set of plugins result in using cached plugins. The only workaround is to reload module with
delete require.cache[require.resolve('css-modulesify')];
.This is happening because of persisting cache globally that was made because
cache
option passed to browserify is forwarded to module-deps where it's filled with record for each module (record for css module contains javascript code generated withcmify.js
). So without persisting tokens and loader between runs when using browserifycache
option (e.g. with rebundler) if css file is not changed then file record is not removed from browserify cache and module-deps does not reapply transformations and css (which is "side-effect" of transformations) is not outputted which was the #32 issue reported by @joeybaker and was fixed by him in #40 by introducing global cache.Persisting cache globally results in issue like I described above and I suggest to use
cache
option that can be reused between runs. So it makes css-modulesify stateless again but allows to persist cache e.g. for using with rebundler.