Skip to content

Commit

Permalink
fix(browser): polyfill assert, process
Browse files Browse the repository at this point in the history
this commit fixes a regression that was introduced in 6702eae (#4073),
where webpack 5 no longer polyfills certain node modules that stencil
had assumed would exist. because these polyfills no longer exist in the
form we previously expected them to be in, `require` statements are
generated for them. however, `require` cannot run in the browser,
causing scripts that import stencil to run their compilation in the
browser to fail.

this commit is inspired by the documentation for `resolve.fallback`,
which redcirects module requests when normal resolution fails. the
documentation provides a list of polyfills that webpack v4 would provide
previously. this commit restores the two that we need.

ref: https://webpack.js.org/configuration/resolve/#resolvefallback
  • Loading branch information
rwaskiewicz committed Feb 28, 2023
1 parent 92fbd1c commit d493987
Show file tree
Hide file tree
Showing 4 changed files with 482 additions and 0 deletions.
Loading

0 comments on commit d493987

Please sign in to comment.