File tree Expand file tree Collapse file tree
packages/devtools-vite/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,6 +96,16 @@ const open = (file: string, line: number) => {
9696}
9797```
9898
99+ - ` injectSource ` - Configuration for source injection. Defaults to enabled.
100+
101+ ``` ts
102+ {
103+ injectSource : {
104+ enabled : true
105+ }
106+ }
107+ ```
108+
99109## Features
100110
101111### Go to source
Original file line number Diff line number Diff line change @@ -28,6 +28,16 @@ export type TanStackDevtoolsViteConfig = {
2828 * @default true
2929 */
3030 enabled : boolean
31+ } ,
32+ /**
33+ * Configuration for source injection.
34+ */
35+ injectSource : {
36+ /**
37+ * Whether to enable source injection via data-tsd-source.
38+ * @default true
39+ */
40+ enabled : boolean
3141 }
3242}
3343
@@ -38,14 +48,15 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
3848 let port = 5173
3949 const appDir = args ?. appDir || './src'
4050 const enhancedLogsConfig = args ?. enhancedLogs ?? { enabled : true }
51+ const injectSourceConfig = args ?. injectSource ?? { enabled : true }
4152 const bus = new ServerEventBus ( args ?. eventBusConfig )
4253
4354 return [
4455 {
4556 enforce : 'pre' ,
4657 name : '@tanstack/devtools:inject-source' ,
4758 apply ( config ) {
48- return config . mode === 'development'
59+ return config . mode === 'development' && injectSourceConfig . enabled
4960 } ,
5061 transform ( code , id ) {
5162 if (
You can’t perform that action at this time.
0 commit comments