We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
esbuild 使用 go 编写,并且比以 js 编写的打包器预构建依赖, 快 10 - 100 倍
webpack 的打包方式是先打包,然后启动开发服务器,请求服务器时直接继续打包结果
vite 是直接启动开发服务器,请求哪个模块再对该模块进行实时编译
由于现代浏览器本身就支持 ES Module,会自动向依赖的 Module 发出请求。 Vite 充分利用了这一点,将开发环境下的模块文件,就作为浏览器要执行的文件,而不是像 Webpack 那样进行打包合并。 由于 Vite 在启动的时候不需要打包,也就意味着不需要分析模块的依赖、不需要编译。 因此启动速度非常快。 当浏览器请求某个模块时,再根据需要对模块内容进行编译。 这种按需动态编译的方式,极大的缩减了编译时间,项目越复杂、模块越多,vite 的优势越明显。 在 HMR(热更新)方面,当改动了一个模块后,仅需让浏览器重新请求该模块即可,不像webpack那样需要把该模块的相关依赖模块全部编译一次,效率更高。 从实际的开发体验来看, 在 Vite 模式下, 开发环境可以瞬间启动, 但是等到页面出来, 要等一段时间。
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: