fix: devtools does not show the setup section of a component for vite build --mode development #4773
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Steps to reproduce
How to create a project by vite (documentation)
Run npm init vite@latest
Enter name
Select Vue (not vue-ts)
Run npm install
Devtools shows "setup" section for dev-server:
Run npm run dev (It starts dev-server for development)
Open http://localhost:3000/
Open devtools
Component "HelloWorld" contains "setup" section in devtools
Devtools doesn't show "setup" section for my build (And component displayed as `Anonymous Component"):
Replace vite build by vite build --mode development inside package.json
Run npm run build. "Dist" folder will be created
Serve the folder using instrument what you prefer. (npm run serve doesn't work for me. I used Golang with http.FileServer for static files and http.ServeFile for index.html)
Open url of your server
Open devtools
Component "HelloWorld" has name Anonymous Component and doesn't contain "setup" section in devtools
What is expected?
Devtools shows "setup" section for my result build (not only for dev-server)
What is actually happening?
Devtools doesn't show "setup" section for my result build
Additional context
See also https://github.com/vuejs/devtools/issues/1544
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).