refactor: Add webawesome and lit as external dependencies#157
Merged
spwoodcock merged 3 commits intomainfrom Oct 29, 2025
Merged
Conversation
…ndling peer dependencies into the library output
spwoodcock
approved these changes
Oct 29, 2025
Member
There was a problem hiding this comment.
Thanks for this suggestion & implementing it!
Sounds like a great way forward to me 😁
Just checking, does lit need to be a peerDep, or can that be a devDep here?
If the consuming app uses the built js, then Lit won't be needed. But I guess if it imports the ts components then it will need Lit installed - is this right? (not ideal, but I guess it can work)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add external peer dependencies to build configuration
Adds
@awesome.me/webawesomeandlitas external dependencies in the esbuild configuration to prevent bundling them into the library output. This ensures peer dependencies are resolved from the consuming application'snode_modulesrather than being bundled.Testing Steps
1. Run a clean build:
@awesome.me/webawesomeandlitare not included in the bundle. (Imports should be preserved)2. Local consumption test
In the consumer
package.jsonadd:Install:
In
vite.config.tsadd:This should only be necessary when testing linking the library locally. This is one of the reasons I think that we should do a staging deploy for additional testing before merging into main.
Start the consumer and verify that the library is working as expected. Open the console and check that errors are no longer showing as before.
Notes: The main changes to the code are the ones in
build.jsand thepackage.json. There is a lot of noise after running a build with the changes made.I did notice some changes included to some of the chunks from the refactor in the last PR that was merged. That is my fault for not running another build after making those changes in the last PR so I went ahead and kept those in there.