Fix issues with Linking Library #141
Draft
+17
−49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
General Summary
Ensure dist directory structure without relying on a custom plugin.
Description
In the case of running
npm run watch
, on the first build vite will run all plugins, but with later rebuilds the plugins are not again run. This causes issues in the scenarion in which you try to build the library locally and link it to a depending application. In those cases changes to the library wont be picked up by the depending application. As a side note, i needed to disable the removal of the dir on each by vite (emptyOutDir option), as otherwise after the first rebuild innpm run watch
the types file would be deleted and the dts plugin would also not trigger. To simulate the clearing beheaviour at least for normal builds, i added arimraf dist
tonpm run build
.How Has This Been Tested?
By localy linking to the BBMRI Sample Locator Application. Please note it was also necessary to add
to the vite config of the depending project, as otherwise vite wont pick up changes.