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.
So this was a fun debugging experience:
Vite scans your app, starting at your HTML files, looking for dependencies to prebundle before it bundles your actual app. Not totally sure I understand why this is necessary in SSR mode, or if
build.lib
is specified, but it happens.Unfortunately, it does that by globbing for HTML files in the project directory. In a standard Vite project that's fine, because it excludes the build directory from the globbing, but it obviously doesn't know not to look at a SvelteKit adapter's output directory.
Suppose you're building an app that uses
adapter-static
to bake out some HTML for every page in your site. Let's further postulate that the site in question has a page for every county in the US, plus a few other pages, and needs to be built twice (the second time for AMP). Finally, imagine that thesrc/app.html
template and its AMP counterpart contain hundreds of elements before you add your content.Vite will try to parse and walk all ~7,000 large pages at once. There is no
--max-old-space-size
that would make this possible.Luckily, disabling it is very easy, hence this PR.