diff --git a/.changesets/10275.md b/.changesets/10275.md deleted file mode 100644 index 7a90f8e05dc8..000000000000 --- a/.changesets/10275.md +++ /dev/null @@ -1,3 +0,0 @@ -- chore(cli): Don't require `web` argument to `yarn rw serve` for RSC apps (#10265) by @cannikin - -Since RSC apps have no api side, just running `yarn rw serve` should serve just the web side automatically, no need to explicitly include the additional `web` argument. diff --git a/packages/cli/src/commands/serve.js b/packages/cli/src/commands/serve.js index c29ac00e3cfe..22b0c9d2aa24 100644 --- a/packages/cli/src/commands/serve.js +++ b/packages/cli/src/commands/serve.js @@ -120,7 +120,7 @@ export const builder = async (yargs) => { // serve both if (positionalArgs.length === 1) { - if (!apiSideExists && !getConfig().experimental?.rsc?.enabled) { + if (!apiSideExists) { console.error( c.error( '\n Unable to serve the both sides as no `api` folder exists. Please use `yarn rw serve web` instead. \n', @@ -129,10 +129,9 @@ export const builder = async (yargs) => { process.exit(1) } - // We need the web side (and api side, if it exists) to have been built + // We need the web side to have been built if ( - (fs.existsSync(path.join(getPaths().api.base)) && - !fs.existsSync(path.join(getPaths().api.dist))) || + !fs.existsSync(path.join(getPaths().api.dist)) || !fs.existsSync(path.join(getPaths().web.dist), 'index.html') ) { console.error(