Skip to content

Commit

Permalink
fix: resolve plugin correctly on windows (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Jul 31, 2022
1 parent e39114d commit 3544713
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/histoire/src/node/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,18 @@ if (import.meta.hot) {
}

if (id === RESOLVED_SUPPORT_PLUGINS_CLIENT) {
const plugins = ctx.supportPlugins.map(p => `'${p.id}': () => import('${require.resolve(`${p.moduleName}/client`, {
const plugins = ctx.supportPlugins.map(p => `'${p.id}': () => import(${JSON.stringify(require.resolve(`${p.moduleName}/client`, {
paths: [ctx.root, import.meta.url],
})}')`)
}))})`)
return `export const clientSupportPlugins = {
${plugins.join(',\n ')}
}`
}

if (id === RESOLVED_SUPPORT_PLUGINS_COLLECT) {
const plugins = ctx.supportPlugins.map(p => `'${p.id}': () => import('${require.resolve(`${p.moduleName}/collect`, {
const plugins = ctx.supportPlugins.map(p => `'${p.id}': () => import(${JSON.stringify(require.resolve(`${p.moduleName}/collect`, {
paths: [ctx.root, import.meta.url],
})}')`)
}))})`)
return `export const collectSupportPlugins = {
${plugins.join(',\n ')}
}`
Expand Down

0 comments on commit 3544713

Please sign in to comment.