Closed segevfiner closed 9 months ago
It is the limitation on the production build.
The devtool relies on the property setupState
in the instance when development.
But the setupState
is not exposed in the production mode. In other words, you cannot inspect the internal state of compiled component.
Can we tweak the build to produce a build conditional on process.env.NODE_ENV
for production vs development build so that the library has debugging available when built as such?
Can we tweak the build to produce a build conditional on process.env.NODE_ENV for production vs development build so that the library has debugging available when built as such?
Nope, most of the libraries are pre-built, so when importing the libraries they are already in "production mode".
Then I found another approach to solve this and pulled a request.
I'm talking about tweaking the build process of my own library to support such a mode. As a flag to vite plugin for vue or something.
I'm talking about tweaking the build process of my own library to support such a mode. As a flag to plugin vue or something.
At this time, due to the limitation of the compiler. The answer is NO.
Or you can try not to compile your library and import .vue
file directly.
So I guess this is a feature request to the compiler. I'll figure out what's the right repo to request that
Somehow I think it is the mis-implementation on devtool.
It will be fixed by https://github.com/vuejs/devtools/pull/2091
So this might also tie into https://github.com/vitejs/vite-plugin-vue/issues/36 which was about the name
but I guess there are also other differences in building components between release and debug.
Any news on this? I still have this problem in 6.5.1. It seems the merge request never got accepted.
Vue devtools version
6.5.0
Link to minimal reproduction
https://github.com/segevfiner/vite-devtools-lib-issue
Steps to reproduce & screenshots
pnpm build
inpackages/foo
pnpm dev
inapps/bar
HelloWorld
component.If you switch the import in
apps/bar/src/App.vue
to import theHelloWorld
component from./components/HelloWorld.vue
instead, the setup state does show in the Vue devtools.What is expected?
It shows setup state for the component imported from the
foo
library.What is actually happening?
It doesn't.
System Info
Any additional comments?
No response