Skip to content

Commit e565aae

Browse files
committed
docs: nextjs plugin config
1 parent 4f902e6 commit e565aae

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

packages/nextjs/README.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
让 Taro H5 支持 [Pre-rendering](https://nextjs.org/docs/basic-features/pages#pre-rendering)[SSR](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props)[ISR](https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration),极致的首屏速度 🚀,利于 SEO 🔍。
1717

1818

19-
> 作为该项目的 Owner,我目前的工作不再涉及 Taro 的开发,难以投入持续的精力来维护该项目,所以正在积极寻找本插件的贡献者。如果你有兴趣,请添加微信 SharpYourMind 与我联系
19+
> 作为这个项目的创建者,我现在的工作已经和 Taro 开发无关,因而无法为其持续投入必要的精力进行维护。此刻,我正在寻找对此插件感兴趣且愿意进行贡献的热心者。如果你有热情并且对本项目感兴趣,请通过添加微信号:SharpYourMind 与我取得联系
2020
2121
## 安装
2222

@@ -182,6 +182,30 @@ class MyComponent extends Component {
182182
+ export default withRouter(MyComponent)
183183
```
184184

185+
## 插件配置
186+
187+
该插件支持以下配置项:
188+
189+
```javascript
190+
const config = {
191+
plugins: [
192+
['tarojs-plugin-platform-nextjs', {
193+
// 当执行 taro build --type nextjs --watch 命令后,是否需要自动执行 next dev 命令
194+
// 默认为 true
195+
runNextjs: true,
196+
// 是否启动后自动打开浏览器
197+
// 默认为 true
198+
browser: true,
199+
// 在插件编译阶段需要复制到 Next.js 中的附加文件
200+
// 作为示例,比如你本地编写的 postcss 插件目录
201+
extraFiles: [
202+
'postcss-plugins/**'
203+
]
204+
}]
205+
]
206+
}
207+
```
208+
185209
## Taro 组件的 React 实现
186210

187211
Taro 官方的 H5 组件库是基于 Stencil 框架开发,为了更好的性能和兼容性,本项目使用完全基于 React 开发的 Taro 组件库 [@taror/components](https://nervjs.github.io/tarojs-plugin-platform-nextjs/)

0 commit comments

Comments
 (0)