Fix issues with using postcss-import plugin and postcss-modules plugin #62
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.
If you are using the
postcss-import
plugin, it requires that it be the first plugin passed to PostCSS (See first note in thepostcss-import
README). Currentlyrollup-plugin-postcss
puts thepostcss-modules
plugin first in the list of PostCSS plugins causing an issue if you use CSS Modulescomposes
from an external file together with@import
syntax from thepostcss-import
plugin. The issue is the data from@import
gets wiped out by the inlining done bycomposes
frompostcss-modules
. Example..Input
Output without this change
Output with this change
This change makes it so that the
postcss-modules
plugin is last in the list of plugins passed to PostCSS.