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

[SYNC] docs: exhibit defineConfig (#4343) #30

Closed
github-actions bot opened this issue Jul 28, 2021 · 0 comments · Fixed by #34
Closed

[SYNC] docs: exhibit defineConfig (#4343) #30

github-actions bot opened this issue Jul 28, 2021 · 0 comments · Fixed by #34
Labels

Comments

@github-actions
Copy link
Contributor

docs: exhibit defineConfig (#4343) (cd44691)


+++ b/docs/guide/api-plugin.md
@@ -34,9 +34,9 @@ Users will add plugins to the project `devDependencies` and configure them using
import vitePlugin from 'vite-plugin-feature'
import rollupPlugin from 'rollup-plugin-feature'
-export default {
+export default defineConfig({
plugins: [vitePlugin(), rollupPlugin()]
-}
+})
```
Falsy plugins will be ignored, which can be used to easily activate or deactivate plugins.
@@ -55,11 +55,12 @@ export default function framework(config) {
```js
// vite.config.js
+import { defineConfig } from 'vite'
import framework from 'vite-plugin-framework'
-export default {
+export default defineConfig({
plugins: [framework()]
-}
+})
```
## Simple Examples
@@ -429,8 +430,9 @@ You can also augment an existing Rollup plugin with Vite-only properties:
```js
// vite.config.js
import example from 'rollup-plugin-example'
+import { defineConfig } from 'vite'
-export default {
+export default defineConfig({
plugins: [
{
...example(),
@@ -438,7 +440,7 @@ export default {
apply: 'build'
}
]
-}
+})
```
Check out [Vite Rollup Plugins](https://vite-rollup-plugins.patak.dev) for a list of compatible official Rollup plugins with usage instructions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants