File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,11 @@ export default createStartHandler({
104
104
if ( opts . name === '@tanstack/react-router-devtools' ) {
105
105
return 'exclude'
106
106
}
107
- if ( 'react' in opts . peerDependencies ) {
107
+ if (
108
+ opts . exports &&
109
+ '.' in opts . exports &&
110
+ 'react' in opts . peerDependencies
111
+ ) {
108
112
return 'include'
109
113
}
110
114
return undefined
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ export interface TanStackStartVitePluginCoreOptions {
47
47
crawlPackages ?: ( opts : {
48
48
name : string
49
49
peerDependencies : Record < string , any >
50
+ exports ?: Record < string , any >
50
51
} ) => 'include' | 'exclude' | undefined
51
52
}
52
53
// this needs to live outside of the TanStackStartVitePluginCore since it will be invoked multiple times by vite
@@ -110,6 +111,7 @@ export function TanStackStartVitePluginCore(
110
111
const internalResult = opts . crawlPackages ?.( {
111
112
name : pkgJson . name ,
112
113
peerDependencies,
114
+ exports : pkgJson . exports ,
113
115
} )
114
116
if ( internalResult ) {
115
117
if ( internalResult === 'exclude' ) {
You can’t perform that action at this time.
0 commit comments