Skip to content

Commit

Permalink
add preview browser list example (#3098)
Browse files Browse the repository at this point in the history
* Update index.md

add preview browserlist example

* Update index.md

add preview browserlist example
  • Loading branch information
whaqzhzd authored Dec 18, 2024
1 parent 28d6a65 commit c5d470f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions versions/3.8/en/editor/project/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ Used to configure various parameters of physics, please refer to the [Physics Co
- **Import Map**: used to control the import behavior of TypeScript/JavaScript, see the [Import Map](../../scripting/modules/import-map.md) documentation for details.

- **Browser list used for preview**: sets the browser list config file for TypeScript/JavaScript compilation at preview time.
> **Example:**
> For instance, when previewing, async/await uses polyfill by default. If we don't want to use polyfill,
> we can create a previewbrowserlist.txt file in the project root directory with the content chrome 80.
> Then go to Project Settings -> Scripts -> Browser List for Preview -> select the previewbrowserlist.txt file.
> Restart the editor or restart the script compilation process. The polyfill for async/await will no longer be applied.
- **Exports Conditions**: specify the parsing conditions for conditionalized export modules, see [Conditional exports](../../scripting/modules/spec.md) for details.

Expand Down
5 changes: 5 additions & 0 deletions versions/3.8/zh/editor/project/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
- **导入映射**:该项用于控制 TypeScript/JavaScript 的导入行为,详情请参考 [Import Map](../../scripting/modules/import-map.md)

- **用于预览的浏览器列表**:设置在预览时 TypeScript/JavaScript 代码编译的浏览器列表文件。
> **示例**
> 比如我们在预览的时候,async/await是使用的polyfill。但我们希望不使用polyfill,
> 那么我们可以在项目根目录下创建一个 previewbrowserlist.txt 文件,内容为 chrome 80
> 然后在项目设置 -> 脚本 -> 用于预览的浏览器列表 -> 选择 previewbrowserlist.txt 这个文件。
> 重启编辑器 或者 重启 脚本编译进程。 对于async/await的profill就没有了。
- **导出条件**:为条件化导出模块指定解析条件,详情可参考 [条件性导出](../../scripting/modules/spec.md#%E6%9D%A1%E4%BB%B6%E6%80%A7%E5%AF%BC%E5%87%BA)

Expand Down

0 comments on commit c5d470f

Please sign in to comment.