Skip to content

[hooks] Assets only needed during development time #2272

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

Open
dcharkes opened this issue May 7, 2025 · 0 comments
Open

[hooks] Assets only needed during development time #2272

dcharkes opened this issue May 7, 2025 · 0 comments

Comments

@dcharkes
Copy link
Collaborator

dcharkes commented May 7, 2025

@liamappelbe brought up an interesting use case: CodeAssets which are only used in development time. For example something for running tests.

In pub we have dependencies and dev_dependencies, and dev_dependencies are not taken into consideration when a package is used as a dependency.

If an asset is only used in test/, then it will be tree-shaken out in the future (#153). However, that still means the hook builds/downloads the asset.

If we'd like to prevent downloading/building the asset, we could consider adding something to the BuildInput/BuildConfig to signal that dev-assets need to be build or not.

However, this also has some downsides:

  • Package authors might accidentally not test their non-dev setup because the behavior for a root package is different.
  • In pub workspaces there are multiple root packages, and we don't want the cache to be invalidated when running from a different root package.

Thoughts @goderbauer @mosuem @HosseinYousefi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant