Skip to content

Commit

Permalink
fix: add missing use of addonRoots, e.g. for setup/katex.ts in addons (
Browse files Browse the repository at this point in the history
  • Loading branch information
twitwi committed Nov 25, 2022
1 parent 7aa6362 commit 430c4f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/slidev/node/common.ts
Expand Up @@ -6,7 +6,7 @@ import type { ConfigEnv, InlineConfig } from 'vite'
import type { ResolvedSlidevOptions } from './options'
import { generateGoogleFontsUrl, toAtFS } from './utils'

export async function getIndexHtml({ clientRoot, themeRoots, data, userRoot }: ResolvedSlidevOptions): Promise<string> {
export async function getIndexHtml({ clientRoot, themeRoots, addonRoots, data, userRoot }: ResolvedSlidevOptions): Promise<string> {
let main = await fs.readFile(join(clientRoot, 'index.html'), 'utf-8')
let head = ''
let body = ''
Expand All @@ -15,6 +15,7 @@ export async function getIndexHtml({ clientRoot, themeRoots, data, userRoot }: R

const roots = uniq([
...themeRoots,
...addonRoots,
userRoot,
])

Expand Down
2 changes: 1 addition & 1 deletion packages/slidev/node/options.ts
Expand Up @@ -146,7 +146,7 @@ export async function resolveOptions(
const themeRoots = getThemeRoots(theme, entry)
const addons = await getAddons(userRoot, data.config)
const addonRoots = getAddonRoots(addons, entry)
const roots = uniq([clientRoot, ...themeRoots, userRoot])
const roots = uniq([clientRoot, ...themeRoots, ...addonRoots, userRoot])

if (themeRoots.length) {
const themeMeta = await getThemeMeta(theme, join(themeRoots[0], 'package.json'))
Expand Down

0 comments on commit 430c4f9

Please sign in to comment.