Open machao7 opened 2 years ago
I think this is intended. (Introduced in https://github.com/vitejs/vite/commit/316d7afc0c84e51359938a12ebe1b09ca34ea8bd)
Why do you need access to render
function?
Related: https://github.com/vuejs/vue-loader/commit/11e3cb8a8a4a4e0aedc2978ce6d7e549a61de3d7
i want create alone app in some popup dialog without any dialog's ctx. in this way, app without render function can't render in dialog.
i found a solution like this:
// com.vue
export default {
...
}
import myself from "./com.vue";
export const openComponentInDialog = function() {
openInDialog(myself)
}
the point of this issue is inconsistent behavior between dev and build mode
I looked a bit more closely. rollup repl
The inconsistent behavior comes from /*#__PURE__*/
and tree-shaking. During dev tree-shaking does not happen.
Here plugin-vue
(and also vue-loader
for reference) assumes a component to be used only from default export.
Now I am not sure if it is intended to assume like that.
Describe the bug
the reference of default export in sfc missing render in build mode.
Reproduction
https://github.com/machao7/vite-vue-plugin
System Info
Used Package Manager
npm
Logs
Validations