File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/vite-plugin-checker/src/checkers/vueTsc Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ import path, { dirname } from 'path'
4
4
import { fileURLToPath } from 'url'
5
5
const _require = createRequire ( import . meta. url )
6
6
7
- const __filename = fileURLToPath ( import . meta. url )
8
- const __dirname = dirname ( __filename )
7
+ // isomorphic __dirname https://antfu.me/posts/isomorphic-dirname
8
+ const _filename = fileURLToPath ( import . meta. url )
9
+ const _dirname = dirname ( _filename )
9
10
10
11
const proxyPath = _require . resolve ( 'vue-tsc/out/proxy' )
11
12
@@ -43,7 +44,7 @@ const textToReplace: { target: string; replacement: string }[] = [
43
44
44
45
export function prepareVueTsc ( ) {
45
46
// 1. copy typescript to folder
46
- const targetTsDir = path . resolve ( __dirname , 'typescript-vue-tsc' )
47
+ const targetTsDir = path . resolve ( _dirname , 'typescript-vue-tsc' )
47
48
const vueTscFlagFile = path . resolve ( targetTsDir , 'vue-tsc-resolve-path' )
48
49
49
50
let shouldPrepare = true
You can’t perform that action at this time.
0 commit comments