File tree 9 files changed +28
-15
lines changed
9 files changed +28
-15
lines changed Original file line number Diff line number Diff line change
1
+ declare const result : boolean
2
+ export default result
Original file line number Diff line number Diff line change
1
+ export default false
Original file line number Diff line number Diff line change
1
+ declare const result : boolean
2
+ export default result
Original file line number Diff line number Diff line change
1
+ export default true
Original file line number Diff line number Diff line change 20
20
"types" : " ./dist/node/index.d.ts" ,
21
21
"exports" : {
22
22
"." : {
23
- "import" : {
24
- "types" : " ./dist/node/index.d.ts" ,
25
- "default" : " ./dist/node/index.js"
26
- },
27
- "require" : {
28
- "types" : " ./index.d.cts" ,
29
- "default" : " ./index.cjs"
30
- }
23
+ "module-sync" : " ./dist/node/index.js" ,
24
+ "import" : " ./dist/node/index.js" ,
25
+ "require" : " ./index.cjs"
31
26
},
32
27
"./client" : {
33
28
"types" : " ./client.d.ts"
34
29
},
35
- "./module-runner" : {
36
- "types" : " ./dist/node/module-runner.d.ts" ,
37
- "import" : " ./dist/node/module-runner.js"
38
- },
30
+ "./module-runner" : " ./dist/node/module-runner.js" ,
39
31
"./dist/client/*" : " ./dist/client/*" ,
40
32
"./types/*" : {
41
33
"types" : " ./types/*"
50
42
]
51
43
}
52
44
},
45
+ "imports" : {
46
+ "#module-sync-enabled" : {
47
+ "module-sync" : " ./misc/true.js" ,
48
+ "default" : " ./misc/false.js"
49
+ }
50
+ },
53
51
"files" : [
54
52
" bin" ,
55
53
" dist" ,
54
+ " misc/**/*.js" ,
56
55
" client.d.ts" ,
57
56
" index.cjs" ,
58
57
" index.d.cts" ,
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ const nodeConfig = defineConfig({
112
112
'fsevents' ,
113
113
'rollup/parseAst' ,
114
114
/ ^ t s x \/ / ,
115
+ / ^ # / ,
115
116
...Object . keys ( pkg . dependencies ) ,
116
117
...Object . keys ( pkg . peerDependencies ) ,
117
118
] ,
Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ const external = [
24
24
25
25
export default defineConfig ( {
26
26
input : {
27
- index : './temp/node/index.d.ts' ,
28
- 'module-runner' : './temp/module-runner/index.d.ts' ,
27
+ index : './temp/src/ node/index.d.ts' ,
28
+ 'module-runner' : './temp/src/ module-runner/index.d.ts' ,
29
29
} ,
30
30
output : {
31
31
dir : './dist/node' ,
Original file line number Diff line number Diff line change @@ -1703,6 +1703,9 @@ async function bundleConfigFile(
1703
1703
fileName : string ,
1704
1704
isESM : boolean ,
1705
1705
) : Promise < { code : string ; dependencies : string [ ] } > {
1706
+ const isModuleSyncConditionEnabled = ( await import ( '#module-sync-enabled' ) )
1707
+ . default
1708
+
1706
1709
const dirnameVarName = '__vite_injected_original_dirname'
1707
1710
const filenameVarName = '__vite_injected_original_filename'
1708
1711
const importMetaUrlVarName = '__vite_injected_original_import_meta_url'
@@ -1741,7 +1744,10 @@ async function bundleConfigFile(
1741
1744
preferRelative : false ,
1742
1745
tryIndex : true ,
1743
1746
mainFields : [ ] ,
1744
- conditions : [ 'node' ] ,
1747
+ conditions : [
1748
+ 'node' ,
1749
+ ...( isModuleSyncConditionEnabled ? [ 'module-sync' ] : [ ] ) ,
1750
+ ] ,
1745
1751
externalConditions : [ ] ,
1746
1752
external : [ ] ,
1747
1753
noExternal : [ ] ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"compilerOptions" : {
3
+ "rootDir" : " ." ,
3
4
"target" : " ES2022" ,
4
5
"module" : " ESNext" ,
5
6
"moduleResolution" : " Bundler" ,
You can’t perform that action at this time.
0 commit comments