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

feat: document frontendExtraFileExtensions #3941

Open
wants to merge 3 commits into
base: latest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions articles/flow/configuration/development-mode/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,25 @@

This is the default mode.

In case the project uses for instance Sass files instead of CSS, the files are not by default taken into account in the bundle contents.
To have the bundle include the `.scss` file content the plugin contains the configuration property `frontendExtraFileExtensions` that takes a comma separated string of extensions to take into account for bundle frontend files.

The default values `'.js', '.js.map', '.ts', '.ts.map', '.tsx', '.tsx.map', '.css', '.css.map'` will always be used and do not need to be mentioned.

Check warning on line 64 in articles/flow/configuration/development-mode/index.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vaadin.Will] Avoid using 'will'. Raw Output: {"message": "[Vaadin.Will] Avoid using 'will'.", "location": {"path": "articles/flow/configuration/development-mode/index.adoc", "range": {"start": {"line": 64, "column": 97}}}, "severity": "WARNING"}

.SASS in the project

Check warning on line 66 in articles/flow/configuration/development-mode/index.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vaadin.Abbr] 'SASS' has no definition. Raw Output: {"message": "[Vaadin.Abbr] 'SASS' has no definition.", "location": {"path": "articles/flow/configuration/development-mode/index.adoc", "range": {"start": {"line": 66, "column": 2}}}, "severity": "WARNING"}
[source,xml]
----
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<!-- plugin goals and other configuration -->
<configuration>
<frontendExtraFileExtensions>scss</frontendExtraFileExtensions>
</configuration>
</plugin>
----

Extensions can also be set as a system property `-Ddevmode.frontendExtraFileExtensions="scss"`, the property works for both the development mode bundle and production mode bundle.

== Easier Debugging

Expand Down
2 changes: 2 additions & 0 deletions articles/flow/configuration/maven.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ Build directory for the project. Defaults to `${project.build.directory}`.
`skipDevBundleRebuild`::
Prevents frontend development bundle from being re-built even if Vaadin decides to use an existing compiled development bundle. This is mainly needed when re-bundling checker in Flow has issues leading to false re-bundling and one needs a workaround while the problem is being resolved. Defaults to `false`.

`frontendExtraFileExtensions`::
Parameter for adding file extensions to handle when generating bundles.

=== Build Frontend Goal Parameters

Expand Down
8 changes: 7 additions & 1 deletion articles/flow/production/production-build.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
<goals>
<goal>build-frontend</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
<configuration>
Expand Down Expand Up @@ -183,6 +182,9 @@
`require.home.node` (default: `false`)::
If set to `true`, always prefer `Node.js` is automatically downloaded and installed into the `.vaadin` sub-directory, in the user's home directory.

`frontendExtraFileExtensions` (default: `null`)::
Parameter for adding extensions of files to be stored in the stats.json of a generated bundle.
For instance if the project uses scss files they are not automatically taken into account in the bundle hashes.

Check failure on line 187 in articles/flow/production/production-build.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'scss'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'scss'?", "location": {"path": "articles/flow/production/production-build.adoc", "range": {"start": {"line": 187, "column": 34}}}, "severity": "ERROR"}

=== `build-frontend`

Expand Down Expand Up @@ -228,6 +230,10 @@
`reactEnable` (default: `true`)::
Whether to use React Router, add React core dependencies, React integration helpers and Vaadin's provided React components (`@vaadin/react-components`). Fallbacks to `vaadin-router`, excludes all React dependencies and adds `Lit` dependencies, if set to `false`.

`frontendExtraFileExtensions` (default: `null`)::
Parameter for adding extensions of files to be stored in the stats.json of a generated bundle.
For instance if the project uses scss files they are not automatically taken into account in the bundle hashes.

Check failure on line 235 in articles/flow/production/production-build.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'scss'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'scss'?", "location": {"path": "articles/flow/production/production-build.adoc", "range": {"start": {"line": 235, "column": 34}}}, "severity": "ERROR"}


=== `clean-frontend`

Expand Down
Loading