chore: fix plugin import

This commit is contained in:
Benjamin Canac
2021-11-23 17:47:52 +01:00
parent 364f9e3b1e
commit a6eef6ae7f
2 changed files with 13 additions and 1 deletions

11
src/dirs.ts Normal file
View File

@@ -0,0 +1,11 @@
import { fileURLToPath } from 'url'
import { resolve } from 'pathe'
export const distDir = resolve(typeof __dirname === 'undefined' ? fileURLToPath(import.meta.url) : __dirname)
const _makeResolve = (base: string) => {
return (...p: string[]) => resolve(base, ...p)
}
export const runtimeDir = resolve(distDir, 'runtime')
export const resolveRuntimeDir = _makeResolve(runtimeDir)