Skip to content

Commit 2552b55

Browse files
authored
Fix/dedupe solid (#200)
* fix: dedupe solid deps for no warnings in the console * changeset
1 parent b236c5c commit 2552b55

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

.changeset/famous-teeth-help.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/devtools-vite': patch
3+
---
4+
5+
dedupe solid deps for no issues in the console

packages/devtools-vite/src/plugin.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,33 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
8282
return addSourceToJsx(code, id)
8383
},
8484
},
85+
{
86+
name: '@tanstack/devtools:config',
87+
enforce: 'pre',
88+
config(_, { command }) {
89+
// we do not apply any config changes for build
90+
if (command !== 'serve') {
91+
return
92+
}
93+
94+
const solidDedupeDeps = [
95+
'solid-js',
96+
'solid-js/web',
97+
'solid-js/store',
98+
'solid-js/html',
99+
'solid-js/h',
100+
]
101+
102+
return {
103+
resolve: {
104+
dedupe: solidDedupeDeps,
105+
},
106+
optimizeDeps: {
107+
include: solidDedupeDeps,
108+
},
109+
}
110+
},
111+
},
85112
{
86113
enforce: 'pre',
87114
name: '@tanstack/devtools:custom-server',

pnpm-lock.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)