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: user configurable outDir #448

Merged
merged 7 commits into from
Jan 6, 2022

Conversation

Mando75
Copy link
Contributor

@Mando75 Mando75 commented Nov 20, 2021

Hi, this is my first time opening a PR in Vitepress, so please let me know if I need to change anything. I did my best to follow the contributing guidelines.

Changes

  • Adds a new outDir option to the UserConfig in .vitepress/config.js.
    • User-provided outDir is resolved the same way as srcDir to keep things consistent.
    • The existing behavior is used as fallback if no outDir is provided by the user.
    • I chose to name it outDir instead of dest (from Vuepress) because the outDir option already existed on the internal SiteConfig type
  • Updates the GitLab deployment docs to use the new outDir to publish files to the top-level public directory in accordance with GitLab pages deployment requirements
  • Adds a .gitignore item for .idea, the .vscode equivalent for JetBrains IDE's (Webstorm, PHPStorm, etc.). I am a WebStorm user, and I figured it may make contributing easier for other developers using JetBrains products.
  • Fixes a typo in a comment I noticed when making these changes.

Motivation

Notes

I included both the feature and doc changes in a single PR since I thought they should be updated together. If you would prefer them split into multiple PRs for better tracking of feat/doc changes, I can do that.

I looked for any tests I should update, but didn't find any. If I missed them, please let me know and I can add a test case.

I have tested it in my Vitepress project using npm link, and it works great. I recorded a video demo that I can provide if you would like to see a demo.

close #171

Update UserConfig to accept an optional outDir and resolve it the same way vitepress resolves srcDir. The original .vitepress/dist behavior is provided as fallback if no user-provided outDir is present. For reference, see vuejs#170.
@Mando75 Mando75 changed the title Feat: User Configurable outDir feat: user configurable outdir Nov 20, 2021
@Mando75 Mando75 changed the title feat: user configurable outdir feat: user configurable outDir Nov 20, 2021
src/node/config.ts Outdated Show resolved Hide resolved
@yyx990803 yyx990803 merged commit 5b04bb9 into vuejs:main Jan 6, 2022
@Mando75 Mando75 deleted the feat/user-configurable-outdir branch January 6, 2022 17:15
@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.

How to configure the build directory of vitepress ?
2 participants