Remove DevFatalErrorPage import when building #8648
Merged
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.
This lets us get rid of the commonjs plugin for Vite.
I went with the "alternative approach" from the description below
From initial description
This is the cause of a lot of issues with Webpack and Vite cross compatibility
Video description:
https://s.tape.sh/NZPq70HZ?s=1.25
We can use https://webpack.js.org/configuration/resolve/ and equivalent in vite to solve this.
i.e. do a normal import, but during build resolve it to null on both webpack and vite - so that its not included in the production build
Subtasks:
Use babel to set imports from
@redwoodjs/web/dist/components/DevFatalErrorPage
to an empty module somehow. This will work in all cases - Vite, Webpack and prerender