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

feat: add farm plugins column #78

Merged
merged 2 commits into from
Apr 13, 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
10 changes: 6 additions & 4 deletions docs/plugins/community-plugins.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Community Plugins

## Farm Plugins

- [farm-pulgin-strip](https://github.com/CCherry07/farm-pulgin-strip): A Farm Rust plugin to remove `debugger` statements and functions like `assert.equal` and `console.log` from your code.

## Vite/Rollup Plugins

Farm support `Vite/Rollup` plugins out of box. So `Vite/Rollup` or `unplugin` plugins can be used in Farm directly.

:::tip
Farm recommends to write Farm Plugins instead of `Vite/Rollup` plugins for Farm. Because Farm Plugins have the best compatibility and performance. Still, PR welcome if you developed a Farm compatible plugin and you want to list it here.
:::

Current tested compatible `Vite/Rollup/unplugin` plugins as below:

## Vite/Rollup Plugins

using `vitePlugins` in `farm.config.ts` to configure `Vite/Rollup` plugins.

```ts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# 社区插件
Farm 支持开箱即用的“Vite/Rollup”插件。 所以 `Vite/Rollup` 或者 `unplugin` 插件可以直接在 Farm 中使用。

## Farm Plugins

- [farm-pulgin-strip](https://github.com/CCherry07/farm-pulgin-strip): 一个 Farm Rust 插件,用于从代码中删除 debugger 语句和函数,例如 assert.equal 和 console.log 。

## Vite/Rollup Plugins

Farm支持 `Vite/Rollup` 插件开箱即用。所以`Vite/Rollup`或`unplugin`插件可以直接在Farm中使用。

:::tip
如果您开发了兼容 Farm 的插件并且想在此处列出,欢迎 PR。
:::

目前测试兼容的`Vite/Rollup/unplugin`插件如下:

## Vite/Rollup Plugins
使用 `farm.config.ts` 中的 `vitePlugins` 来配置 `Vite/Rollup` 插件。

```ts
Expand All @@ -23,13 +27,14 @@ const config: UserConfig = {
}
```

* **[`@vitejs/plugin-vue`](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/README.md)**: Vue 支持.
* **[`@vitejs/plugin-vue-jsx`](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx)**: Vue Jsx/Tsx 支持.
* **[`vite-plugin-solid`](https://www.npmjs.com/package/vite-plugin-solid)**: Solid 支持
* **[`vite-plugin-mock`](https://www.npmjs.com/package/vite-plugin-solid)**: Mock 数据.
* ...
- **[`@vitejs/plugin-vue`](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/README.md)**: Vue 支持.
- **[`@vitejs/plugin-vue-jsx`](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx)**: Vue Jsx/Tsx 支持.
- **[`vite-plugin-solid`](https://www.npmjs.com/package/vite-plugin-solid)**: Solid 支持
- **[`vite-plugin-mock`](https://www.npmjs.com/package/vite-plugin-solid)**: Mock 数据.
- ...

## unplugin

:::note
目前,您可以在 Farm 中使用“unplugin/vite”进行“unplugin/rollup”。 当[此 PR](https://github.com/unjs/unplugin/pull/341) 合并到 unplugin 时,`unplugin/farm` 将可用。
:::
Expand Down Expand Up @@ -66,6 +71,7 @@ const config: UserConfig = {
```

Farm 支持所有 unplugin 插件:

- [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import)
- [unplugin-vue2-script-setup](https://github.com/antfu/unplugin-vue2-script-setup)
- [unplugin-icons](https://github.com/antfu/unplugin-icons)
Expand All @@ -89,4 +95,4 @@ Farm 支持所有 unplugin 插件:
- [unplugin-fonts](https://github.com/cssninjaStudio/unplugin-fonts)
- [sentry-javascript-bundler-plugins](https://github.com/getsentry/sentry-javascript-bundler-plugins)
- [unplugin-svg-component](https://github.com/Jevon617/unplugin-svg-component)
- [unplugin-vue-cssvars](https://github.com/baiwusanyu-c/unplugin-vue-cssvars)
- [unplugin-vue-cssvars](https://github.com/baiwusanyu-c/unplugin-vue-cssvars)
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Farm 需要 **Node 16.18.0 及更高版本**。
## 2.启动项目

选择您喜欢的包管理器,安装依赖项,然后启动项目。
然后,启动项目:
<>
<Tabs>
<TabItem value="npm" label="npm">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ Farm 需要 **Node 16 及以上**。

## 2.启动项目

选择您喜欢的包管理器,然后依赖项将自动安装。
然后,启动项目:
选择您喜欢的包管理器,安装依赖项,然后启动项目。
<>
<Tabs>
<TabItem value="npm" label="npm">
Expand Down
Loading