Skip to content

Commit

Permalink
fix: build errors with pnpm, closes #42
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Mar 16, 2022
1 parent 42f9f96 commit 67103d8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/histoire/src/node/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { relative } from 'pathe'
import { createRequire } from 'module'
import { relative, dirname } from 'pathe'
import { resolveConfig as resolveViteConfig, Plugin as VitePlugin } from 'vite'
import { lookup as lookupMime } from 'mrmime'
import { APP_PATH, DIST_CLIENT_PATH } from './alias.js'
Expand All @@ -8,6 +9,8 @@ import { makeTree } from './tree.js'
import { parseColor } from './colors.js'
import { createMarkdownRenderer } from './markdown.js'

const require = createRequire(import.meta.url)

export const STORIES_ID = '$histoire-stories'
export const RESOLVED_STORIES_ID = `/${STORIES_ID}-resolved`
export const SETUP_ID = '$histoire-setup'
Expand Down Expand Up @@ -45,9 +48,11 @@ export async function createVitePlugins (ctx: Context): Promise<VitePlugin[]> {
// force include vue to avoid duplicated copies when linked + optimized
include: [
'vue',
'@vue/runtime-core',
'shiki',
'case',
dirname(require.resolve('@vue/runtime-core/package.json')),
dirname(require.resolve('shiki/package.json')),
dirname(require.resolve('vscode-textmate/package.json')),
dirname(require.resolve('vscode-oniguruma/package.json')),
dirname(require.resolve('case/package.json')),
],
},
server: {
Expand Down

0 comments on commit 67103d8

Please sign in to comment.