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: support user-provided vite plugins #394

Merged
merged 3 commits into from
Oct 7, 2021
Merged

Conversation

fnlctrl
Copy link
Member

@fnlctrl fnlctrl commented Sep 16, 2021

Currently vite plugins defined in .vitepress/config.js are ignored, e.g.

module.exports = {
  vite: {
    plugins: [
      myPlugin() // doesn't work
    ]
  }
}

Therefore, userViteConfig.plugins is appended to createVitePressPlugin result to support custom vite plugins

@lencx
Copy link

lencx commented Sep 19, 2021

@fnlctrl I found the solution here #241 (comment)

example: lencx/code-snippets/docs/vite.config.js

[root]
|- [docs]
|	 |- [.vitepress]
|	 |- vite.config.js
|	 `- ...

@fnlctrl
Copy link
Member Author

fnlctrl commented Sep 19, 2021

@lencx Thanks for the workaround! Didn't know it was possible.

The vite option was introduced in 3737b10 so I think plugins defined in it should also work

@yyx990803 yyx990803 merged commit 4b76617 into vuejs:main Oct 7, 2021
@fnlctrl fnlctrl deleted the patch-1 branch October 9, 2021 03:12
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants