13

vite build uses esbuild to transform both the package dependencies (node modules) as well as the app source code into the target JavaScript specification, i.e. es2015.

I observe that vite/esbuild re-transform the entire sources in ./node_modules every time vite build is run.

How can this build stack be used to keep and reuse the previously transformed files, at least for the entire ./node_modules folder (given dependencies didn't change of course) so that subsequent vite build command invocations run significantly faster?

Lars Blumberg
  • 19,326
  • 11
  • 90
  • 127
  • Are you looking for ways to improve the performance of subsequent Vite build command invocations? If yes I will post an answer as soon as you confirm that. – Nova Jan 22 '23 at 14:23
  • 2
    Vite transpiles all node modules to the target JS/EcmaScript version every time `vite build` is run. This can be quite time consuming. So specifically I'd like Vite to reuse the transpilation results from the previous build run. And more generally, yes I'd like to improve performance of subsequent Vite build command invocations. – Lars Blumberg Jan 22 '23 at 17:31

0 Answers0