Prop type information lost when building
Version
3.2.32
Reproduction link
Steps to reproduce
- Create a component with a prop
- Build using
vite build
What is expected?
The compiled component should store prop type information
I copied the component code to SFC playground, and this is the result
const __sfc__ = /*#__PURE__*/_defineComponent({
props: {
extraClass: { type: String, required: false, default: '' }
},
emits: ["close"],
setup(__props, { emit }
) {
...
The prop has correct type information
What is actually happening?
This is the output for the same component, but built using vite
const _sfc_main = /* @__PURE__ */ defineComponent({
props: {
extraClass: { default: "" }
},
emits: ["close"],
setup(__props, { emit }) {
The prop has lost all type information
The SFC playground is here
Going to the above reproduction link, the component in question can be found at src/components/modal/ModalComponent.vue