You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building a Vue component library using Vite and this plugin. Component names are not emitted into productions builds of the library. This hinders debugging using the Vue devtools when using such libraries as all components from the library will show as anonymous component.
Suggested solution
Add an option to keep component names in production build gated behind a NODE_ENV check so that they can be stripped during bundling, that way they can be kept when using a library in development mode.
Alternative
Do this manually in each and every Vue file in the library.
Additional context
Hit this with @tiptap/vue-3 but also with our own custom Vite + Vue based libraries.
if(devToolsEnabled||(devServer&&!isProduction)){// expose filename during serve for devtools to pickupattachedProps.push([`__file`,JSON.stringify(isProduction ? `process.env.NODE_ENV !== "production" ? ${path.basename(filename)} : void 0` : filename),])}
But when devtools are enabled in production the user might want to keep the name even in production, so we need a specific flag for this, this is meant for Vue libraries so they can keep names during development but allow Vite to strip them in production.
Related plugins
plugin-vue
plugin-vue-jsx
Description
When building a Vue component library using Vite and this plugin. Component names are not emitted into productions builds of the library. This hinders debugging using the Vue devtools when using such libraries as all components from the library will show as anonymous component.
Suggested solution
Add an option to keep component names in production build gated behind a
NODE_ENV
check so that they can be stripped during bundling, that way they can be kept when using a library in development mode.Alternative
Do this manually in each and every Vue file in the library.
Additional context
Hit this with
@tiptap/vue-3
but also with our own custom Vite + Vue based libraries.Validations
The text was updated successfully, but these errors were encountered: