File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { JsxImportRuntime } from './hmr/jsx-import-runtime'
7
7
import { CountProvider } from './context/CountProvider'
8
8
import { ContextButton } from './context/ContextButton'
9
9
import { TestImportAttributes } from './import-attributes/test'
10
+ import { TEST_NON_JSX , TestNonJsx } from './non-jsx/test'
10
11
11
12
function App ( ) {
12
13
const [ count , setCount ] = useState ( 0 )
@@ -47,6 +48,8 @@ function App() {
47
48
< JsxImportRuntime />
48
49
< Button > button</ Button >
49
50
< TestImportAttributes />
51
+ { TestNonJsx ( ) }
52
+ { TEST_NON_JSX ( ) }
50
53
</ div >
51
54
)
52
55
}
Original file line number Diff line number Diff line change @@ -163,4 +163,10 @@ if (!isBuild) {
163
163
. poll ( ( ) => page . textContent ( '#accordion-root' ) )
164
164
. toMatch ( 'Accordion Root Updated' )
165
165
} )
166
+
167
+ test ( 'no refresh transform for non-jsx files' , async ( ) => {
168
+ const res = await page . request . get ( viteTestUrl + '/non-jsx/test.ts' )
169
+ const code = await res . text ( )
170
+ expect ( code ) . not . toContain ( '$RefreshReg$' )
171
+ } )
166
172
}
Original file line number Diff line number Diff line change
1
+ export const TestNonJsx = ( ) => {
2
+ return 'TestNonJsx'
3
+ }
4
+
5
+ export const TEST_NON_JSX = ( ) => {
6
+ return 'TEST_NON_JSX'
7
+ }
You can’t perform that action at this time.
0 commit comments