You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In JavaScript, require is not reserved, however many bundling tools do things to make it seem like it is.
For webpack, the unlazy-loader transforms the pattern used in this utils.js file, so that require is not reassigned.
I'm not as familiar with vite (is it using esbuild?), but there might be a way to configure transformation plugins in a similar fashion. If there isn't a direct way to use a webpack plugin with vite, the unlazy-loader function could be wrapped in a way to adapter to vite.
I hope this helps, and if you try something that works (or almost works), please let us know.
Thanks for this cool lib!
I'm trying to use this lib in a frontend project using vite, when I build my project with esbuild I got the following error:
Looks like
require
is a reserved word and can't be changed, so how to solve this?The text was updated successfully, but these errors were encountered: