File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,12 @@ export type RscPluginOptions = {
110110
111111 /** Escape hatch for Waku's `allowServer` */
112112 keepUseCientProxy ?: boolean
113+
114+ /**
115+ * The packages which depends on `frameworkPackages` will be added to `noExternal`
116+ * @default ["react"]
117+ */
118+ frameworkPackages ?: string [ ]
113119}
114120
115121export default function vitePluginRsc (
@@ -128,10 +134,14 @@ export default function vitePluginRsc(
128134 isBuild : env . command === 'build' ,
129135 isFrameworkPkgByJson ( pkgJson ) {
130136 if ( [ PKG_NAME , 'react-dom' ] . includes ( pkgJson . name ) ) {
131- return
137+ return false
138+ }
139+ const deps = {
140+ ...pkgJson [ 'dependencies' ] ,
141+ ...pkgJson [ 'peerDependencies' ] ,
132142 }
133- const deps = pkgJson [ 'peerDependencies' ]
134- return deps && 'react' in deps
143+ Object . keys ( deps )
144+ return 'react' in deps
135145 } ,
136146 } )
137147 const noExternal = [
You can’t perform that action at this time.
0 commit comments