Skip to content
New issue

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

docs: add runtime isolate #97

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/config/compilation-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ interface FarmRuntimeOptions {
path: string;
plugins?: string[];
namespace?: string;
isolate?: boolean;
};
}
```
Expand All @@ -334,6 +335,14 @@ Configure the Runtime plug-in, through the Runtime plug-in, you can intervene in

Configure the namespace of Farm Runtime to ensure that the execution of different products under the same window or global can be isolated from each other. By default, the name field of the project package.json is used as the namespace.

#### `runtime.isolate`

- **default**: `false`

By default, runtime files in html are written inline. If you want to reduce the size of the html file by popping it up as a separate file, then you can set this attribute to true.
If set to true, the farm entry script will be emitted as a separate file.


### assets

#### `assets.include`
Expand Down Expand Up @@ -856,4 +865,4 @@ Enable progress bar or not.
Preserve comments or not:
* `true`: Preserve all comments
* `false`: Remove all comments
* `license`: Preserve all **LICENSE comments**, and remove the others
* `license`: Preserve all **LICENSE comments**, and remove the others
9 changes: 7 additions & 2 deletions docs/plugins/official-plugins/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Refer to [Using Plugins](/docs/using-plugins) for how to use plugins in Farm.
* **[`@farmfe/js-plugin-dts`](./js-dts)**:Support compiling `*.d.ts` files.
* **[`@farmfe/js-plugin-sass`](./js-sass)**:Support compiling `sass/scss` files.

:::tip

## Community Plugins

If official plugins doesn't meet your needs, you can try [Community Plugins](../community-plugins)
:::

And of course check out [awesome-farm](https://github.com/farm-fe/awesome-farm) - you can also submit a PR to list your plugins there.


2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const config = {
},
{
label: "Awesome Farm",
href: "https://github.com/farm-fe",
href: "https://github.com/farm-fe/awesome-farm",
},
{
label: "Discord",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ interface FarmRuntimeOptions {
path: string;
plugins?: string[];
namespace?: string;
isolate?: boolean;
};
}
```
Expand All @@ -339,6 +340,14 @@ interface FarmRuntimeOptions {

配置 Farm Runtime 的命名空间,保证在同一个 window 或者 global 下不同产物的执行能够相互隔离。默认使用项目 package.json 的 name 字段作为 namespace。


#### `runtime.isolate`

- **默认值**: `false`

默认情况下,html 中的运行时文件是内联写入的。如果您想以单独文件的形式弹出,从而减小 html 文件的大小,那么可以将此属性设为 true。
如果设置为 true,农场入口脚本将以单独文件的形式发布。

### assets

#### `assets.include`
Expand Down Expand Up @@ -850,4 +859,4 @@ export default defineConfig({
配置如何处理注释:
* `true`: 保留所有注释
* `false`: 删除所有注释
* `license`: 保留所有 **LICENSE 注释**, 移除所有非 LICENSE 注释
* `license`: 保留所有 **LICENSE 注释**, 移除所有非 LICENSE 注释
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Farm官方提供了很多有用的插件,包括Rust插件和JS插件。 Rust
* **[`@farmfe/js-plugin-dts`](./js-dts)**:支持编译`sass/scss`文件。
* **[`@farmfe/js-plugin-sass`](./js-sass)**:支持编译`sass/scss`文件。

:::tip
如果官方插件不能满足您的需求,您可以尝试[社区插件](../community-plugins)
:::

## 社区插件

如果官方插件不能满足您的需求,您可以尝试[社区插件](../community-plugins)。


当然也可以前往查看 [awesome-farm](https://github.com/farm-fe/awesome-farm) - 您也可以提交 PR,在那里列出您的插件。
Loading