File tree Expand file tree Collapse file tree 3 files changed +53
-7
lines changed
packages/plugin-react-swc Expand file tree Collapse file tree 3 files changed +53
-7
lines changed Original file line number Diff line number Diff line change 1+ name : Preview Publish
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ types : [opened, synchronize, labeled]
9+
10+ permissions : {}
11+
12+ jobs :
13+ preview :
14+ if : >
15+ github.repository == 'vitejs/vite-plugin-react' &&
16+ (github.event_name == 'push' ||
17+ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'trigger: preview')))
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v4
22+
23+ - name : Install pnpm
24+ uses : pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
25+
26+ - uses : actions/setup-node@v4
27+ with :
28+ node-version : lts/*
29+ cache : pnpm
30+
31+ - name : Install dependencies
32+ run : pnpm install
33+
34+ - name : Build
35+ run : pnpm build
36+
37+ - name : Publish
38+ run :
pnpm dlx [email protected] publish --pnpm --compact './packages/*' './packages/plugin-react-swc/dist'
Original file line number Diff line number Diff line change 66
77Added ` filter ` so that it is more performant when running this plugin with rolldown-powered version of Vite.
88
9+ ### Skip HMR preamble in Vitest browser mode
10+
11+ This was causing annoying ` Sourcemap for "/@react-refresh" points to missing source files ` and is unnecessary in test mode.
12+
913## 3.9.0 (2025-04-15)
1014
1115### Make compatible with rolldown-vite
Original file line number Diff line number Diff line change @@ -142,13 +142,17 @@ const react = (_options?: Options): PluginOption[] => {
142142 )
143143 }
144144 } ,
145- transformIndexHtml : ( _ , config ) => [
146- {
147- tag : 'script' ,
148- attrs : { type : 'module' } ,
149- children : getPreambleCode ( config . server ! . config . base ) ,
150- } ,
151- ] ,
145+ transformIndexHtml : ( _ , config ) => {
146+ if ( ! hmrDisabled ) {
147+ return [
148+ {
149+ tag : 'script' ,
150+ attrs : { type : 'module' } ,
151+ children : getPreambleCode ( config . server ! . config . base ) ,
152+ } ,
153+ ]
154+ }
155+ } ,
152156 async transform ( code , _id , transformOptions ) {
153157 const id = _id . split ( '?' ) [ 0 ]
154158 const refresh = ! transformOptions ?. ssr && ! hmrDisabled
You can’t perform that action at this time.
0 commit comments