Open ggecy opened 7 months ago
This exclude
parameter was introduced in https://github.com/vaadin/flow/pull/15700 in order to dix the compilation problems of third-party JS/TS add-ons/libraries in Flow applications, see https://github.com/vaadin/flow/issues/15485. Thus, we cannot remove it completely.
Originally the idea was to exclude JS from JAR resources, but we haven't taken into account multi-module projects.
One can modify the tsconfig.json
file and then this file shouldn't be overridden by Vaadin for next run.
Thus, I think that just removing the exclude
parameter would be enough to fix the issue and it's not a bug in Vaadin.
Yes, I had to remove exclude
from all tsconfig.json files after migration to v24 and it stays removed after that. However it wasn't really obvious what's broken at first glance so I created the issue because it wasn't in migration instructions and it broke the build.
Thanks, then I believe this is a matter of documenting this case in our migration guide.
Description of the bug
Hi, we have a big maven multi module project where typescript files are located in many modules on
src/main/resources/META-INF/resources/frontend/src/...
paths. We are using aliases defined in tsconfig.json together with filesystem links to fake the file locations during development to make the editing of files in different modules at least somehow tolerable, so Intellij Idea doesn't just display a ton of errors in editor. However tsconfig.json that is generated by vaadin by default contains the property"exclude": ["frontend/generated/jar-resources/**"]
, which prevents the project from compiling because the aliases are not resolved in exlcluded files and all files from all maven modules in the project end up in thatfrontend/generated/jar-resources
folder. This is an example tsconfig.json from our project from one of the bootstrap modules - see additianl alias in "paths" property:Each maven module containing the typescript source files has its own "fake" tsconfig.json inside where the
CommonsWeb
alias has different relative path pointing to a linked src dir from common web module. That way idea can resolve the imports correctly while editing files in their respective modules while vaadin can also compile them when they end up all together insidefrontend/generated/jar-resources
folder in bootstrap module. Project can only compile if I remove the "exclude" property value in tsconfig.json.vite-config.ts
also need thevite-tsconfig-paths
plugin to respect the aliases defined in tsconfig.json file:Expected behavior
Default generated tsconfig.json file should work in multimodule environment.
Minimal reproducible example
-
Versions