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

Include .scss and .sass in stats.json hashes #19527

Open
oliveryasuna opened this issue Jun 6, 2024 · 3 comments · May be fixed by #19550
Open

Include .scss and .sass in stats.json hashes #19527

oliveryasuna opened this issue Jun 6, 2024 · 3 comments · May be fixed by #19550

Comments

@oliveryasuna
Copy link
Contributor

oliveryasuna commented Jun 6, 2024

Describe your motivation

We use SASS (.scss) stylesheets under /frontend/styles. These are imported and fully supported by Vite. It seems that the vaadin:stats Vite plugin does not generate hashes for them and store in stats.json#frontendHashes. Because of this, even with prod.bundle, the Vaadin Maven/Gradle plugins think there are new files, and thus, do not use the existing bundle.

Describe the solution you'd like

const projectFileExtensions = ['.js', '.js.map', '.ts', '.ts.map', '.tsx', '.tsx.map', '.css', '.css.map']; needs to also support .scss and .sass.

Is there a reason those file extensions are not already included? If not, happy to contribute this simple PR.

Describe alternatives you've considered

I could write a Vite plugin that computes and adds the hashes.

I could create a Gradle task that compiles the SASS files and outputs them to /frontend/styles.

Both options seem messy.

Additional context

I discovered this while investigating ways to speed up our builds, in lieu of Vaadin's proper Gradle caching support. #17941

This idea came from our recent endeavour to speed up builds. Relevant issues:

@steve-todorov
Copy link

In addition to scss and sass extensions, people might also use less so might be beneficial to add it to the extension list as well.

@oliveryasuna
Copy link
Contributor Author

Maybe extensions should be customizable with an include/exclude pattern.

@oliveryasuna oliveryasuna linked a pull request Jun 11, 2024 that will close this issue
9 tasks
@oliveryasuna
Copy link
Contributor Author

I opened a draft PR to demonstrate my proposal: #19550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants