Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions playground/react/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Button from 'jsx-entry'
import WithQuery from './components/WithQuery?qs-should-not-break-plugin-react'
import { Accordion } from './components/Accordion'
import Parent from './hmr/parent'
import InjectExportsLater from './hmr/inject-exports-later'
import { JsxImportRuntime } from './hmr/jsx-import-runtime'
import { CountProvider } from './context/CountProvider'
import { ContextButton } from './context/ContextButton'
Expand Down Expand Up @@ -45,6 +46,7 @@ function App() {
<Accordion.Item>Second Item</Accordion.Item>
</Accordion.Root>
<Parent />
<InjectExportsLater />
<JsxImportRuntime />
<Button>button</Button>
<TestImportAttributes />
Expand Down
3 changes: 3 additions & 0 deletions playground/react/hmr/inject-exports-later.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function InjectExportsLater() {
return <div id="inject-exports-later">Inject exports later</div>
}
13 changes: 12 additions & 1 deletion playground/react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ import type { UserConfig } from 'vite'
const config: UserConfig = {
server: { port: 8902 /* Should be unique */ },
mode: 'development',
plugins: [react()],
plugins: [
react(),
{
name: 'add-export',
transform: {
filter: { id: /\/inject-exports-later\.jsx$/ },
handler(code) {
return code + '\nexport const testArray = ["1", "2", "3"];'
},
},
},
],
build: {
// to make tests faster
minify: false,
Expand Down
Loading