Skip to content

Commit b1adcc7

Browse files
chore: Linting and disable some console logs (#9635)
1 parent 1dcac65 commit b1adcc7

File tree

2 files changed

+30
-34
lines changed

2 files changed

+30
-34
lines changed

packages/vite/src/rsc/rscBuildServer.ts

+26-31
Original file line numberDiff line numberDiff line change
@@ -94,37 +94,32 @@ export async function rscBuildServer(
9494
// The map function below will return '..' for local files. That's not
9595
// very pretty, but it works. It just won't match anything.
9696
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+
}),
128123
resolve: {
129124
externalConditions: ['react-server'],
130125
},

packages/web/src/config.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// RWJS_ENV and RWJS_DEBUG_ENV
22
// are defined in Webpack.common.js and Vite.config.js
33

4-
console.log('config.ts')
5-
console.log('config.ts', RWJS_ENV)
6-
console.log('config.ts')
4+
// Note: These lines are useful during RSC/SSR development but will execute for all projects, even those without RSC/SSR
5+
// console.log('config.ts')
6+
// console.log('config.ts', RWJS_ENV)
7+
// console.log('config.ts')
78

89
// @NOTE: do not use globalThis on the right side, because webpack cannot access these vars then
910
globalThis.RWJS_API_GRAPHQL_URL = RWJS_ENV.RWJS_API_GRAPHQL_URL as string

0 commit comments

Comments
 (0)