mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 21:07:47 +00:00
[cli][dev] fix: creating "api/some-func.js" after "vc dev" now works (#8041)
If there is no `api` directory, then you run `vc dev`, then you create a new function `api/some-func.js`, then this file would not be served as a new function. This was being caused by incomplete "new file" handling logic. This PR ensures that the proper detection is done in each new file (`getVercelConfig`) that populates key properties (`apiDir`, `apiExtensions`, and extensionless `files`) for determining when a file is used to serve a request.
This commit is contained in:
@@ -329,6 +329,8 @@ export default class DevServer {
|
||||
): Promise<void> {
|
||||
const name = relative(this.cwd, fsPath);
|
||||
try {
|
||||
await this.getVercelConfig();
|
||||
|
||||
this.files[name] = await FileFsRef.fromFsPath({ fsPath });
|
||||
const extensionless = this.getExtensionlessFile(name);
|
||||
if (extensionless) {
|
||||
|
||||
Reference in New Issue
Block a user