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

Avoid different chunks' content after each build for Vue components with @apply #3356

Merged
merged 1 commit into from Jan 29, 2021

Conversation

hivokas
Copy link
Contributor

@hivokas hivokas commented Jan 14, 2021

When we use @apply in the styles of the Vue component, the resulting chunks' content is different after each build (the reason why I want chunks' content to be the same after each build described here: #3349).

And the difference lays here:

That's because PostCSS generates random Input#id if from is not provided (https://postcss.org/api/#input-id).

So in order to fix the problem described above, from needs to be provided. That's what this PR does.

I was wondering about the best value for the from option and had decided to use __filename since the idea of the from option is to help users to find the source of the CSS (thanks @ai: postcss/postcss#1512 (comment))

Fixes #3349

@codecov-io
Copy link

Codecov Report

Merging #3356 (b23f8f8) into master (3fa7a22) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3356   +/-   ##
=======================================
  Coverage   93.28%   93.28%           
=======================================
  Files         178      178           
  Lines        1831     1831           
  Branches      324      323    -1     
=======================================
  Hits         1708     1708           
  Misses        105      105           
  Partials       18       18           
Impacted Files Coverage Δ
src/lib/substituteClassApplyAtRules.js 95.12% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fa7a22...b23f8f8. Read the comment docs.

@adamwathan
Copy link
Member

Thank you, this looks solid 👍🏻 Appreciate you digging deep and contributing the solution to your problem, I'll try and get a tag out for this soon.

@adamwathan adamwathan merged commit 43afae4 into tailwindlabs:master Jan 29, 2021
@hivokas
Copy link
Contributor Author

hivokas commented Jan 30, 2021

Thank you, this looks solid 👍🏻 Appreciate you digging deep and contributing the solution to your problem, I'll try and get a tag out for this soon.

Thanks for merging!

This was referenced Mar 15, 2021
This was referenced Mar 18, 2021
adamwathan pushed a commit that referenced this pull request May 7, 2021
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

Successfully merging this pull request may close these issues.

@apply leads to different chunks' content after each build
3 participants