-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
Event Type exports virally expose code to build #2350
Comments
interesting that https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax exposing it in the
At least that gets my vote. |
Because
./dist/events/*
is not surfaced for access in a consuming project,shoelace/package.json
Lines 13 to 31 in 6761fdc
And the event types are reexported without the
type
label:shoelace/src/shoelace.ts
Line 69 in 6761fdc
While the project does not list
sideeffects
inpackage.json
, imports likeimport type { SlSelectEvent } from "@shoelace-style/shoelace";
can virally expose the entirety of the project to bundlers.The easiest fix is likely surfacing
./dist/events/*
as a package export so that event types can be accessed externally via a path with no runtime code allowing the consumer to fix their own problems here.Alternative options require a little testing, that I think will work out, but are less simple/guaranteed:
type
label should fix this issue at the TypeScript level; (IIUC) it's absence confused the build into being unable to separate types from actual code in that import.sideeffect
listings topackage.json
to prevent vitality at the bundle level. This can be difficult to maintain over time, but is a great way to ensure consumers have the smallest amount of code built into their applications.The text was updated successfully, but these errors were encountered: