When using the defineOptions macro in the setup script, the static literal header comment in the code is incorrectly positioned
Vue version
3.5.11
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-z1m5xq?file=src%2FApp.vue
Steps to reproduce
- use the setup script in the code and utilizing the defineOptions macro.
- define a static literal and add a comment
- run the code
What is expected?
this is the result when the defineOptions macro is not used.
What is actually happening?
System Info
No response
Any additional comments?
No response
Thank you for reporting this. Based on the details provided, it appears that this issue does not cause any functional problems or bugs in the code. It is primarily a matter of comment positioning, which does not affect the execution or behavior of the application.
Yes, this has almost no impact. However, I now want to perform some processing based on the code that has been handled by the compiler, similar to eslint-disable-next-line, which is causing some confusion.
The code output of compiler-sfc is not meant to provide any guarantees about post-processing, if we commit to that it's going to lead to a whole category of additional issues.
Source-code processing should happen before the SFC is compiled by Vue.