File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ import { someMethod } from 'my-dep'
12
12
13
13
上面的代码会在浏览器中抛出一个错误。Vite 将会检测到所有被加载的源文件中的此类裸模块导入,并执行以下操作:
14
14
15
- 1 . [ 预构建] ( ./dep-pre-bundling ) 它们以加快页面加载速度 ,并将 CommonJS / UMD 转换为 ESM 格式。预构建这一步由 [ esbuild] ( http://esbuild.github.io/ ) 执行,这使得 Vite 的冷启动时间比任何基于 JavaScript 的打包器都要快得多。
15
+ 1 . [ 预构建] ( ./dep-pre-bundling ) 它们可以提高页面加载速度 ,并将 CommonJS / UMD 转换为 ESM 格式。预构建这一步由 [ esbuild] ( http://esbuild.github.io/ ) 执行,这使得 Vite 的冷启动时间比任何基于 JavaScript 的打包器都要快得多。
16
16
17
17
2 . 重写导入为合法的 URL,例如 ` /node_modules/.vite/my-dep.js?v=f3sf2ebd ` 以便浏览器能够正确导入它们。
18
18
19
19
** 依赖是强缓存的**
20
20
21
- Vite 通过 HTTP 头来缓存请求得到的依赖,所以如果你想要编辑或调试一个依赖,请跟随 [ 这里] ( ./dep-pre-bundling#浏览器缓存 ) 的步骤 。
21
+ Vite 通过 HTTP 头来缓存请求得到的依赖,所以如果你想要编辑或调试一个依赖,请按照 [ 这里] ( ./dep-pre-bundling#浏览器缓存 ) 的步骤操作 。
22
22
23
23
## 模块热重载 {#hot-module-replacement}
24
24
You can’t perform that action at this time.
0 commit comments