Skip to content

Commit

Permalink
feat: add override beastiesOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Dec 25, 2024
1 parent 684245d commit 54037a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/valaxy/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export async function ssgBuild(
script: 'async',
formatting: 'minify',
beastiesOptions: {
reduceInlineStyles: false,
preload: 'swap',
// reduceInlineStyles: false,
...(options.config.beastiesOptions || {}),
},
onFinished() {
generateSitemap(
Expand Down
10 changes: 9 additions & 1 deletion packages/valaxy/node/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type Vue from '@vitejs/plugin-vue'

import type { Options as BeastiesOptions } from 'beasties'
import type { Hookable } from 'hookable'
import type { PluginVisualizerOptions } from 'rollup-plugin-visualizer'
import type { presetAttributify, presetIcons, presetTypography, presetUno } from 'unocss'
import type { VitePluginConfig as UnoCSSConfig } from 'unocss/vite'

import type { VitePluginConfig as UnoCSSConfig } from 'unocss/vite'
import type Components from 'unplugin-vue-components/vite'
import type Markdown from 'unplugin-vue-markdown/vite'
import type { EditableTreeNode } from 'unplugin-vue-router'
Expand All @@ -14,6 +15,7 @@ import type { UserConfig as ViteUserConfig } from 'vite'
import type Layouts from 'vite-plugin-vue-layouts'
import type { createValaxyNode } from './app'
import type { ResolvedValaxyOptions } from './options'

import type { MarkdownOptions } from './plugins/markdown/types'

export type ValaxyNodeConfig<ThemeConfig = DefaultTheme.Config> = ValaxyConfig<ThemeConfig> & ValaxyExtendConfig
Expand Down Expand Up @@ -226,6 +228,12 @@ export interface ValaxyExtendConfig {
* @see https://valaxy.site/guide/custom/hooks
*/
hooks?: Partial<ValaxyHooks>

/**
* beastiesOptions
* @see https://github.com/danielroe/beasties
*/
beastiesOptions?: BeastiesOptions
}

export type ValaxyAddonLike = ValaxyAddon | false | null | undefined
Expand Down

0 comments on commit 54037a0

Please sign in to comment.