[ALOY-1731] Webpack: Alloy loader recompiles unchanged components
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | n/a |
| Labels | n/a |
| Reporter | Jan Vennemann |
| Assignee | Jan Vennemann |
| Created | 2020-06-02T18:12:03.000+0000 |
| Updated | 2020-06-02T18:12:03.000+0000 |
Description
The Alloy loader uses [addDependency](https://webpack.js.org/api/loaders/#thisadddependency) to define dependencies of Alloy components. This is used to re-compile a component if it's view or styles changes. However, this can cause unwanted behavior in certain cases:
- If a component has no .tss file, it will constantly be recompiled when another component triggers a rebuild. This is because Webpack thinks it needs to recompile it as well, since its style file was missing, and it may have been created in the meantime.
- We could check if the style file actually exists before adding it as a dependency to prevent these unwanted rebuilds. But if a user now creates the style file, Webpack won't trigger the recompile for the component because it doesn't now about the dependency.
To address this a solution needs to be found that allows to add all dependencies of a component while also preventing unnecessary rebuilds.
No comments