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

Compiled files are changed after each build (even if there are no changes) #2773

Closed
hivokas opened this issue Jan 13, 2021 · 5 comments
Closed
Assignees

Comments

@hivokas
Copy link
Contributor

hivokas commented Jan 13, 2021

  • Laravel Mix Version: 6.0.9
  • Node Version: v15.2.0
  • NPM Version: 6.14.9
  • OS: macOS

Description:

In the project I'm working on right now we store compiled assets in the repository. We use GitHub Actions to automatically compile assets once changes are pushed to the PR. The problem is that once assets are compiled, the number of changed files in the PR grows up to ~120. I want to find a way to decrease this number.

Steps To Reproduce:

I've created a repository to demonstrate this issue: https://github.com/hivokas/laravel-mix-playground-random-postcss-input-id

What I've noticed so far:

  • it happens only if the Vue component uses TailwindCSS's @apply;
  • if we use @apply, this part of the chunk (the component is imported dynamically via import()) is different after each build (same for chunk's .map file):

image

- looks like this part is `Input#id` generated by PostCSS (https://postcss.org/api/#input-id).

I'm looking for a way to avoid this part being different for each build.

Is there a way to do that from within Laravel Mix? Or I should resubmit this issue to another repo?

@thecrypticace
Copy link
Collaborator

That's some good (and rather useful) research on the PostCSS input ID details! My guess is that this only happens because source maps are enabled. However, I'm not sure this is something we can fix. I believe this is likely something to be fixed in either vue-loader or tailwind. I'll do some poking around hopefully this weekend.

@thecrypticace thecrypticace self-assigned this Jan 13, 2021
@hivokas
Copy link
Contributor Author

hivokas commented Jan 14, 2021

I believe this is likely something to be fixed in either vue-loader or tailwind.

I've submitted the issue to the TailwindCSS repository: tailwindlabs/tailwindcss#3349. Let's see.

@hivokas
Copy link
Contributor Author

hivokas commented Jan 14, 2021

I've submitted the PR to TailwindCSS that should fix this problem: tailwindlabs/tailwindcss#3356

@stale
Copy link

stale bot commented Jun 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@hivokas
Copy link
Contributor Author

hivokas commented Jun 11, 2021

It has been fixed in tailwindlabs/tailwindcss#3356

@hivokas hivokas closed this as completed Jun 11, 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

No branches or pull requests

2 participants