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 2222 }
2323
2424 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+ ) {
2630 text ( '.cjs-dynamic-dep-cjs-compiled-from-cjs' , 'ok' )
2731 }
2832
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { Socket } from 'phoenix'
77import clip from 'clipboard'
88import cjsFromESM from '@vitejs/test-dep-cjs-compiled-from-esm'
99import cjsFromCJS from '@vitejs/test-dep-cjs-compiled-from-cjs'
10+ import * as cjsFromCJSNamespace from '@vitejs/test-dep-cjs-compiled-from-cjs'
1011
1112// Test exporting a name that was already imported
1213export { useState } from 'react'
@@ -25,7 +26,11 @@ if (typeof cjsFromESM === 'function') {
2526 text ( '.cjs-dep-cjs-compiled-from-esm' , 'ok' )
2627}
2728
28- if ( typeof cjsFromCJS === 'function' ) {
29+ if (
30+ typeof cjsFromCJS === 'function' &&
31+ typeof cjsFromCJSNamespace !== 'function' &&
32+ cjsFromCJSNamespace . bar === 'bar'
33+ ) {
2934 text ( '.cjs-dep-cjs-compiled-from-cjs' , 'ok' )
3035}
3136
Original file line number Diff line number Diff line change 22function foo ( ) {
33 return 'foo'
44}
5+ foo . bar = 'bar'
56module . exports = foo
You can’t perform that action at this time.
0 commit comments