Skip to content
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

Add notes about separate unbundled bundles for ESbuild #1348

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

KonnorRogers
Copy link
Contributor

Hi there! I recently got Lit SSR setup with Web Awesome / Shoelace and wanted to share some snags I hit. Happy to document these somewhere else or change wording, just wanted to add some things I was missing until I found @e111077 's 11ty SSR Example and their ESBuild config.

https://github.com/e111077/11ty-lit/blob/204a7d3a060acced0573745d57147cbfe95abb1e/esbuild.config.mjs#L76-L86

@augustjk
Copy link
Contributor

augustjk commented Jul 3, 2024

/gcbrun

@augustjk
Copy link
Contributor

augustjk commented Jul 3, 2024

Thanks for the PR! I reworded and reorganized the content a bit. We already mentioned conditional exports at the end of the browser-only code section so made that into a subheading and added the package.json example there.

Made the bundler section a bit more clear that the ideal path is to mark everything external, which won't require separate entrypoints (unless your own library code has node-specific things you want to do). And if you must bundle Lit into, that's when the two entrypoints are required.

/gcbrun

@augustjk
Copy link
Contributor

augustjk commented Jul 3, 2024

@KonnorRogers
Copy link
Contributor Author

@augustjk thanks for that!! And hmm 🤔 maybe I gotta double check what I was doing with ESBuild if I was marking the initial components as having no externals and bundling in Lit. I'll report back when I get a shot to look again.

@KonnorRogers KonnorRogers changed the title Add notes about separate Node vs Browser bundles for ESbuild Add notes about separate unbundled bundles for ESbuild Jul 4, 2024
@KonnorRogers
Copy link
Contributor Author

@augustjk was extending another config and forgot to set packages: "external" in my esbuild config, which is why platform: "node" worked 🤦

@augustjk augustjk merged commit bafbf70 into lit:main Jul 15, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants