@@ -94,37 +94,32 @@ export async function rscBuildServer(
94
94
// The map function below will return '..' for local files. That's not
95
95
// very pretty, but it works. It just won't match anything.
96
96
noExternal : Object . values ( clientEntryFiles ) . map ( ( fullPath ) => {
97
- // On Windows `fullPath` will be something like
98
- // D:/a/redwood/test-project-rsc-external-packages/node_modules/@tobbe.dev/rsc-test/dist/rsc-test.es.js
99
- const relativePath = path . relative (
100
- path . join ( rwPaths . base , 'node_modules' ) ,
101
- fullPath
102
- )
103
- // On Windows `relativePath` will be something like
104
- // @tobbe .dev\rsc-test\dist\rsc-test.es.js
105
- // So `splitPath` will in this case become
106
- // ['@tobbe.dev', 'rsc-test', 'dist', 'rsc-test.es.js']
107
- const splitPath = relativePath . split ( path . sep )
108
-
109
- // Packages without scope. Full package name looks like: package_name
110
- let packageName = splitPath [ 0 ]
111
-
112
- // Handle scoped packages. Full package name looks like:
113
- // @org_name /package_name
114
- if ( splitPath [ 0 ] . startsWith ( '@' ) ) {
115
- // join @org_name with package_name
116
- packageName = path . join ( splitPath [ 0 ] , splitPath [ 1 ] )
117
- }
118
-
119
- console . log (
120
- 'noExternal fullPath' ,
121
- fullPath ,
122
- 'packageName' ,
123
- packageName
124
- )
125
-
126
- return packageName
127
- } ) ,
97
+ // On Windows `fullPath` will be something like
98
+ // D:/a/redwood/test-project-rsc-external-packages/node_modules/@tobbe.dev/rsc-test/dist/rsc-test.es.js
99
+ const relativePath = path . relative (
100
+ path . join ( rwPaths . base , 'node_modules' ) ,
101
+ fullPath
102
+ )
103
+ // On Windows `relativePath` will be something like
104
+ // @tobbe .dev\rsc-test\dist\rsc-test.es.js
105
+ // So `splitPath` will in this case become
106
+ // ['@tobbe.dev', 'rsc-test', 'dist', 'rsc-test.es.js']
107
+ const splitPath = relativePath . split ( path . sep )
108
+
109
+ // Packages without scope. Full package name looks like: package_name
110
+ let packageName = splitPath [ 0 ]
111
+
112
+ // Handle scoped packages. Full package name looks like:
113
+ // @org_name /package_name
114
+ if ( splitPath [ 0 ] . startsWith ( '@' ) ) {
115
+ // join @org_name with package_name
116
+ packageName = path . join ( splitPath [ 0 ] , splitPath [ 1 ] )
117
+ }
118
+
119
+ console . log ( 'noExternal fullPath' , fullPath , 'packageName' , packageName )
120
+
121
+ return packageName
122
+ } ) ,
128
123
resolve : {
129
124
externalConditions : [ 'react-server' ] ,
130
125
} ,
0 commit comments