feat: user configurable `outDir` (#448)

pull/486/head
Bryan Müller 3 years ago committed by GitHub
parent fb6a4ad3e0
commit 5b04bb9eb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

3
.gitignore vendored

@ -7,4 +7,5 @@
dist
node_modules
TODOs.md
.vscode
.vscode
.idea

@ -136,7 +136,7 @@ deploy:
If you are deploying to `https://<USERNAME or GROUP>.gitlab.io/<REPO>/`, for example your repository is at `https://gitlab.com/<USERNAME>/<REPO>`, then set `base` to `'/<REPO>/'`.
2. Set `dest` in `.vitepress/config.js` to `public`.
2. Set `outDir` in `.vitepress/config.js` to `../public`.
3. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content:

@ -38,7 +38,7 @@ export interface UserConfig<ThemeConfig = any> {
locales?: Record<string, LocaleConfig>
markdown?: MarkdownOptions
/**
* Opitons to pass on to `@vitejs/plugin-vue`
* Options to pass on to `@vitejs/plugin-vue`
*/
vue?: VuePluginOptions
/**
@ -48,6 +48,7 @@ export interface UserConfig<ThemeConfig = any> {
srcDir?: string
srcExclude?: string[]
outDir?: string
shouldPreload?: (link: string, page: string) => boolean
/**
@ -105,6 +106,7 @@ export async function resolveConfig(
const [userConfig, configPath] = await resolveUserConfig(root, command, mode)
const site = await resolveSiteData(root, userConfig)
const srcDir = path.resolve(root, userConfig.srcDir || '.')
const outDir = userConfig.outDir ? path.resolve(root, userConfig.outDir) : resolve(root, 'dist')
// resolve theme path
const userThemeDir = resolve(root, 'theme')
@ -132,7 +134,7 @@ export async function resolveConfig(
themeDir,
pages,
configPath,
outDir: resolve(root, 'dist'),
outDir,
tempDir: resolve(root, '.tmp'),
markdown: userConfig.markdown,
alias: resolveAliases(themeDir),

Loading…
Cancel
Save