Skip to content

Commit

Permalink
fix(e2e): use subpath import for distDir string
Browse files Browse the repository at this point in the history
resolves #818
  • Loading branch information
danielroe committed Dec 5, 2024
1 parent 365830d commit 094acb2
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .nuxtrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
typescript.tsConfig.compilerOptions.paths.@nuxt/test-utils/e2e=["../dist/e2e.mjs"]
typescript.tsConfig.compilerOptions.paths.#dirs=["./dirs.js"]
1 change: 1 addition & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default defineBuildConfig({
{ input: 'src/runtime/', outDir: 'dist/runtime', format: 'esm' },
],
externals: [
'#dirs',
'#app/entry',
'#build/root-component.mjs',
'#imports',
Expand Down
1 change: 1 addition & 0 deletions dirs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const distDir: string
4 changes: 4 additions & 0 deletions dirs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { fileURLToPath } from 'node:url'
import { dirname } from 'pathe'

export const distDir = dirname(fileURLToPath(new URL('./dist', import.meta.url)))
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
"./runtime": "./dist/runtime-utils/index.mjs",
"./vitest-environment": "./dist/vitest-environment.mjs"
},
"imports": {
"#dirs": "./dirs.js"
},
"files": [
"dist",
"dirs.js",
"config.d.ts",
"e2e.d.ts",
"experimental.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/core/run.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'pathe'
import { distDir } from '../dirs'
import { distDir } from '#dirs'

export interface RunTestOptions {
rootDir: string
Expand Down
4 changes: 0 additions & 4 deletions src/dirs.ts

This file was deleted.

0 comments on commit 094acb2

Please sign in to comment.