Allow packages to be marked 'external' #1316
Rich-Harris
started this conversation in
Ideas
Replies: 1 comment 7 replies
-
This is a great call-out, we actually have config to support this but since an external import would almost always fail in the browser we've never really documented it in Snowpack. You can see the full list of supported This should work:
|
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using Snowpack to build an app that will run in Node (i.e.
snowpack build --ssr
), I encounter errors like this:A possible solution would be to add an
external
option that is an array of package names that Snowpack should ignore. For example:Since
snowpack build --ssr
is generally likely to be used alongsidesnowpack build
, I don't think we can just automatically ignore built-in modules in SSR mode (for example in Svelte apps, you're likely to have modules that are only invoked by the server, but which are nevertheless in a directory that is mounted in both SSR and non-SSR scenarios, so Snowpack would hit the same 'not found' problem when building that mounted directory in non-SSR mode) — it probably needs user control.Beta Was this translation helpful? Give feedback.
All reactions