File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
dep-cjs-compiled-from-cjs Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 22
22
}
23
23
24
24
const cjsFromCJS = await import ( '@vitejs/test-dep-cjs-compiled-from-cjs' )
25
- if ( typeof cjsFromCJS . default === 'function' ) {
25
+ if (
26
+ typeof cjsFromCJS . default === 'function' &&
27
+ typeof cjsFromCJS !== 'function' &&
28
+ cjsFromCJS . bar === 'bar'
29
+ ) {
26
30
text ( '.cjs-dynamic-dep-cjs-compiled-from-cjs' , 'ok' )
27
31
}
28
32
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { Socket } from 'phoenix'
7
7
import clip from 'clipboard'
8
8
import cjsFromESM from '@vitejs/test-dep-cjs-compiled-from-esm'
9
9
import cjsFromCJS from '@vitejs/test-dep-cjs-compiled-from-cjs'
10
+ import * as cjsFromCJSNamespace from '@vitejs/test-dep-cjs-compiled-from-cjs'
10
11
11
12
// Test exporting a name that was already imported
12
13
export { useState } from 'react'
@@ -25,7 +26,11 @@ if (typeof cjsFromESM === 'function') {
25
26
text ( '.cjs-dep-cjs-compiled-from-esm' , 'ok' )
26
27
}
27
28
28
- if ( typeof cjsFromCJS === 'function' ) {
29
+ if (
30
+ typeof cjsFromCJS === 'function' &&
31
+ typeof cjsFromCJSNamespace !== 'function' &&
32
+ cjsFromCJSNamespace . bar === 'bar'
33
+ ) {
29
34
text ( '.cjs-dep-cjs-compiled-from-cjs' , 'ok' )
30
35
}
31
36
Original file line number Diff line number Diff line change 2
2
function foo ( ) {
3
3
return 'foo'
4
4
}
5
+ foo . bar = 'bar'
5
6
module . exports = foo
You can’t perform that action at this time.
0 commit comments