externalize @player-ui/player from native bundles#483
externalize @player-ui/player from native bundles#483
Conversation
|
/canary |
|
Can we do this as a part of the rule to minimize the config needed on the usage side? |
It would likely require pulling more than what I touch out of this repo, since we define the template in this repo too: |
Ah, sorry. I thought we had some base tsup config that was expanded in our rules. |
| load("@npm//:defs.bzl", "npm_link_all_packages") | ||
| load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config") | ||
|
|
||
| # TODO: Would be nice to macro all the native things to avoid missing this setup (consequence is bundling Player in a plugin bundle) |
There was a problem hiding this comment.
Do you have any estimate for how much effort this would require? If its not huge would it be worth it to just do it now?
| if (process.env.PLAYER_NATIVE_BUNDLE) { | ||
| overrides.esbuildPlugins = [ESBuildPluginExternalGlobal.externalGlobalPlugin({ | ||
| // TODO: Would be cool to automatically populate this given all the native bundles we create | ||
| "@player-ui/player": "globalThis.Player", |
Currently, the plugin native bundles contain an entire copy of Player - this PR externalizes the Player from the native bundles, reducing size burden of the native bundles.
Change Type (required)
Indicate the type of change your pull request is:
patchminormajorDoes your PR have any documentation updates?