This repository has been archived by the owner on Dec 26, 2018. It is now read-only.
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.
I noticed some problems with the scoped modules, especially when using Watchify and the
extract-css
plugin.These bugs do not occur when restarting Browserify before every render, but get really annoying when using Watchify and keeping the program state around.
There were two bugs that his Pull Request addresses:
When changing nothing except the
scoped
attribute on a<style>
tag, the CSS would not get updated. This is because the value ofscoped
wasn't part of the cachekey
. I fixed that by simply adding thescoped
variable to the key.When Watchify did another bundling, the
addId
PostCSS plugin fromlib/style-rewriter.js
got added another time, but didn't get removed if the component was notscoped
. This led to multiple[data-v-x]
ids on selectors as well as ids on selectors that shouldn't even be scoped. For example:I fixed that by ensuring the
plugins
array only has a maximum of 1addId
function, and by removing the function if the component is not scoped.