-
Notifications
You must be signed in to change notification settings - Fork 178
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
build(components, shared-data): fix components and shared-data npm deploy actions #15180
Conversation
0ad90a7
to
a06812a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. What a weird constraint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and works when importing! sorry i forgot to approve!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
Overview
Since the vite migration our npm publish github action has been publishing an unusable artifact for the following reasons:
main
entry path points to the old bundle name that webpack generated@opentrons/components
, which leads to build errors when trying to import modules that don't existnew URL()
constructor do not point to an asset that is bundled into the production build. This means we get an import error when a consumer builds their project because it can't find assets we reference in our code. Ex:^this works fine in development, but in a production build we'll get an error like this:
It turns out that the way vite interprets:
is... different. Vite does not like the first option, but it is okay with the second option. tbh im confused as to why, since the calls to the
URL
constructor are evaluated immediately (not lazily).Anyways, this PR fixes these issues.
Review Requests
Try out version 0.1.6-alpha.7 of the components library and see if it works for y'all
Risk assessment
Low/medium