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
I am currently transforming a Webpack+Vue2 project to Vite (3.2.3) and noticed that running vite build takes very long, around 12 minutes in my case. It hangs at the UMD transpilation step. We have dependencies like ant-design-vue and mathjs, so the output files are quite large. Nonetheless, the build process should scale linearly, but it doesn't seem to.
Profiling the situation gave me this statistic:
This is the INJECT_HELPERS_UMD_RE regex used in vite:esbuild-transpile, defined here:
Most of the processing time is consumed by running that regex. So it is probably still the same problem as #8738 and #8099.
Copying the output that is to be replaced and the regex to regex101.com indeed results in a "catastrophic backtracking" error. #8110 may have reduced it, but not enough it seems.
We would like to switch to Vite for performance reasons, so this is something of a deal breaker currently.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
I am currently transforming a Webpack+Vue2 project to Vite (3.2.3) and noticed that running
vite build
takes very long, around 12 minutes in my case. It hangs at the UMD transpilation step. We have dependencies likeant-design-vue
andmathjs
, so the output files are quite large. Nonetheless, the build process should scale linearly, but it doesn't seem to.Profiling the situation gave me this statistic:
This is the
INJECT_HELPERS_UMD_RE
regex used invite:esbuild-transpile
, defined here:Most of the processing time is consumed by running that regex. So it is probably still the same problem as #8738 and #8099.
Copying the output that is to be replaced and the regex to regex101.com indeed results in a "catastrophic backtracking" error. #8110 may have reduced it, but not enough it seems.
We would like to switch to Vite for performance reasons, so this is something of a deal breaker currently.
Thanks in advance!
Reproduction
https://github.com/Flynamic/vite-reproduce-slow-regex
Steps to reproduce
Set up a Vue+Vite project with lots of heavy dependencies and build it as a
umd
library.git clone https://github.com/Flynamic/vite-reproduce-slow-regex && cd vite-reproduce-slow-regex
npm install
vite build
You should see something like the following output after a very reasonable time:
and after a very unreasonable time...
System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: