Skip to content

Commit

Permalink
docs(cn): resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
waynzh committed Aug 13, 2023
1 parent 5556a69 commit fb5f4c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 61 deletions.
54 changes: 4 additions & 50 deletions guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ vite [root]

#### 选项 {#options}

<<<<<<< HEAD
| 选项 | |
| ------------------------ | ------------------------------------------- |
| 选项 | |
| ------------------------ | -------------------------------------------------------------------------------------- |
| `--host [host]` | 指定主机名称 (`string`) |
| `--port <port>` | 指定端口 (`number`) |
| `--https` | 使用 TLS + HTTP/2 (`boolean`) |
Expand All @@ -28,32 +27,12 @@ vite [root]
| `--base <path>` | 公共基础路径(默认为:`/`)(`string`) |
| `-l, --logLevel <level>` | Info \| warn \| error \| silent (`string`) |
| `--clearScreen` | 允许或禁用打印日志时清除屏幕 (`boolean`) |
| `--profile` | 启动内置的 Node.js 调试器(查看 [性能瓶颈](/guide/troubleshooting#performance-bottlenecks)|
| `-d, --debug [feat]` | 显示调试日志 (`string \| boolean`) |
| `-f, --filter <filter>` | 过滤调试日志 (`string`) |
| `-m, --mode <mode>` | 设置环境模式 (`string`) |
| `-h, --help` | 显示可用的 CLI 选项 |
| `-v, --version` | 显示版本号 |
=======
| Options | |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `--host [host]` | Specify hostname (`string`) |
| `--port <port>` | Specify port (`number`) |
| `--https` | Use TLS + HTTP/2 (`boolean`) |
| `--open [path]` | Open browser on startup (`boolean \| string`) |
| `--cors` | Enable CORS (`boolean`) |
| `--strictPort` | Exit if specified port is already in use (`boolean`) |
| `--force` | Force the optimizer to ignore the cache and re-bundle (`boolean`) |
| `-c, --config <file>` | Use specified config file (`string`) |
| `--base <path>` | Public base path (default: `/`) (`string`) |
| `-l, --logLevel <level>` | Info \| warn \| error \| silent (`string`) |
| `--clearScreen` | Allow/disable clear screen when logging (`boolean`) |
| `--profile` | Start built-in Node.js inspector (check [Performance bottlenecks](/guide/troubleshooting#performance-bottlenecks)) |
| `-d, --debug [feat]` | Show debug logs (`string \| boolean`) |
| `-f, --filter <filter>` | Filter debug logs (`string`) |
| `-m, --mode <mode>` | Set env mode (`string`) |
| `-h, --help` | Display available CLI options |
| `-v, --version` | Display version number |
>>>>>>> d508009a71058d02563d45e4e519f44453d414c0

## 构建 {#build}

Expand All @@ -69,7 +48,6 @@ vite build [root]

#### 选项 {#options-1}

<<<<<<< HEAD
| 选项 | |
| ------------------------------ | -------------------------------------------------------------------------------------------- |
| `--target <target>` | 编译目标(默认为:`"modules"`)(`string`) |
Expand All @@ -88,35 +66,11 @@ vite build [root]
| `--base <path>` | 公共基础路径(默认为:`/`)(`string`) |
| `-l, --logLevel <level>` | Info \| warn \| error \| silent (`string`) |
| `--clearScreen` | 允许或禁用打印日志时清除屏幕 (`boolean`) |
| `--profile` | 启动内置的 Node.js 调试器(查看 [性能瓶颈](/guide/troubleshooting#performance-bottlenecks)|
| `-d, --debug [feat]` | 显示调试日志 (`string \| boolean`) |
| `-f, --filter <filter>` | 过滤调试日志 (`string`) |
| `-m, --mode <mode>` | 设置环境模式 (`string`) |
| `-h, --help` | 显示可用的 CLI 选项 |
=======
| Options | |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
| `--target <target>` | Transpile target (default: `"modules"`) (`string`) |
| `--outDir <dir>` | Output directory (default: `dist`) (`string`) |
| `--assetsDir <dir>` | Directory under outDir to place assets in (default: `"assets"`) (`string`) |
| `--assetsInlineLimit <number>` | Static asset base64 inline threshold in bytes (default: `4096`) (`number`) |
| `--ssr [entry]` | Build specified entry for server-side rendering (`string`) |
| `--sourcemap [output]` | Output source maps for build (default: `false`) (`boolean \| "inline" \| "hidden"`) |
| `--minify [minifier]` | Enable/disable minification, or specify minifier to use (default: `"esbuild"`) (`boolean \| "terser" \| "esbuild"`) |
| `--manifest [name]` | Emit build manifest json (`boolean \| string`) |
| `--ssrManifest [name]` | Emit ssr manifest json (`boolean \| string`) |
| `--force` | Force the optimizer to ignore the cache and re-bundle (experimental)(`boolean`) |
| `--emptyOutDir` | Force empty outDir when it's outside of root (`boolean`) |
| `-w, --watch` | Rebuilds when modules have changed on disk (`boolean`) |
| `-c, --config <file>` | Use specified config file (`string`) |
| `--base <path>` | Public base path (default: `/`) (`string`) |
| `-l, --logLevel <level>` | Info \| warn \| error \| silent (`string`) |
| `--clearScreen` | Allow/disable clear screen when logging (`boolean`) |
| `--profile` | Start built-in Node.js inspector (check [Performance bottlenecks](/guide/troubleshooting#performance-bottlenecks)) |
| `-d, --debug [feat]` | Show debug logs (`string \| boolean`) |
| `-f, --filter <filter>` | Filter debug logs (`string`) |
| `-m, --mode <mode>` | Set env mode (`string`) |
| `-h, --help` | Display available CLI options |
>>>>>>> d508009a71058d02563d45e4e519f44453d414c0

## 其他 {#others}

Expand Down
18 changes: 7 additions & 11 deletions guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,9 @@ import './Foo.js' // 应该为 './foo.js'

在 Vite 中通过一个哈希值来决定优化后的依赖项是否有效,这个值取决于包锁定的内容、应用于依赖项的补丁以及 Vite 配置文件中影响 node_modules 打包的选项。这意味着,当使用像 [npm overrides](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides) 这样的功能覆盖依赖项时,Vite 将检测到,并在下一次服务器启动时重新打包您的依赖项。当您使用像 [npm link](https://docs.npmjs.com/cli/v9/commands/npm-link) 这样的功能时,Vite 不会使依赖项无效。如果您链接或取消链接一个依赖项,那么您需要使用 `vite --force` 在下一次服务器启动时强制重新预构建。我们建议使用 overrides,它们现在被每个包管理器所支持(还可以参见 [pnpm overrides](https://pnpm.io/package_json#pnpmoverrides)[yarn resolutions](https://yarnpkg.com/configuration/manifest/#resolutions))。

<<<<<<< HEAD
## 其他 {#others}
=======
## Performance bottlenecks
## 性能瓶颈 {#performance-bottlenecks}

If you suffer any application performance bottlenecks resulting in slow load times, you can start the built-in Node.js inspector with your Vite dev server or when building your application to create the CPU profile:
如果你遇到应用程序性能瓶颈导致加载缓慢,可以在启动 Vite 开发服务器或在构建应用程序时使用内置的 Node.js 调试器来创建 CPU 性能分析文件:

::: code-group

Expand All @@ -163,16 +160,15 @@ vite build --profile

:::

::: tip Vite Dev Server
Once your application is opened in the browser, just await finish loading it and then go back to the terminal and press `p` key (will stop the Node.js inspector) then press `q` key to stop the dev server.
::: tip Vite 开发服务器
一旦应用程序在浏览器中打开,请等待其完成加载,然后返回终端并按下 `p` 键(将停止 Node.js 调试器),然后按下 `q` 键停止开发服务器。
:::

Node.js inspector will generate `vite-profile-0.cpuprofile` in the root folder, go to https://www.speedscope.app/, and upload the CPU profile using the `BROWSE` button to inspect the result.
Node.js 调试器将在根文件夹中生成 `vite-profile-0.cpuprofile` 文件,前往 https://www.speedscope.app/,点击 `BROWSE` 按钮上传 CPU 性能分析文件以检查结果。

## Others
>>>>>>> d508009a71058d02563d45e4e519f44453d414c0
## 其他 {#others}

### Module externalized for browser compatibility {#module-externalized-for-browser-compatibility}
### 为了浏览器兼容性而模块外部化 {#module-externalized-for-browser-compatibility}

当你在浏览器中使用一个 Node.js 模块时,Vite 会输出以下警告:

Expand Down

0 comments on commit fb5f4c2

Please sign in to comment.