Skip to content

Commit 748d2e9

Browse files
braineoAlemTuzlakautofix-ci[bot]
authored
fix: fix import.meta compatibility issue in rsbuild (#203)
* fix: fix import.meta compatibility issue in rsbuild rsbuild requires directly property access otherwise it will throw: Accessing import.meta directly is unsupported (only property access or destructuring is supported) * add changeset * update optional issue * ci: apply automated fixes --------- Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent c6e80bc commit 748d2e9

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.changeset/soft-peas-turn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/devtools': patch
3+
---
4+
5+
fix import.meta usage in rsbuild

packages/devtools/src/context/pip-context.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ export const PiPProvider = (props: PiPProviderProps) => {
5555
)
5656
}
5757

58-
const meta = typeof import.meta !== 'undefined' ? import.meta : null
59-
60-
meta?.hot?.on('vite:beforeUpdate', () => {
58+
import.meta.hot?.on('vite:beforeUpdate', () => {
6159
localStorage.setItem('pip_open', 'false')
6260
closePipWindow()
6361
})

0 commit comments

Comments
 (0)