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'
77import { CountProvider } from './context/CountProvider'
88import { ContextButton } from './context/ContextButton'
99import { TestImportAttributes } from './import-attributes/test'
10+ import { TEST_NON_JSX , TestNonJsx } from './non-jsx/test'
1011
1112function App ( ) {
1213 const [ count , setCount ] = useState ( 0 )
@@ -47,6 +48,8 @@ function App() {
4748 < JsxImportRuntime />
4849 < Button > button</ Button >
4950 < TestImportAttributes />
51+ { TestNonJsx ( ) }
52+ { TEST_NON_JSX ( ) }
5053 </ div >
5154 )
5255}
Original file line number Diff line number Diff line change @@ -163,4 +163,10 @@ if (!isBuild) {
163163 . poll ( ( ) => page . textContent ( '#accordion-root' ) )
164164 . toMatch ( 'Accordion Root Updated' )
165165 } )
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+ } )
166172}
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