vuejs / devtools

⚙️ Browser devtools extension for debugging Vue.js applications.
https://devtools.vuejs.org/
MIT License
1.71k stars 121 forks source link

refactor(vite): load devtools resource #521

Closed alexzhang1030 closed 4 months ago

alexzhang1030 commented 4 months ago

I will dig into Vite and investigate why Vite can't resolve this.

Closes #518

netlify[bot] commented 4 months ago

Deploy Preview for vue-devtools-docs canceled.

Name Link
Latest commit 397fb1b93e996bf81a5aff130d1f2130df73b834
Latest deploy log https://app.netlify.com/sites/vue-devtools-docs/deploys/669f415f98dd2d00087c47aa
alexzhang1030 commented 4 months ago

The vite internal implementation of direct load assets by absolute path is here, it called a function isFileServingAllowed to check the ability. But there are some limitations when using this way to load devtools assets, like if we set server.fs.strict to true, devtools assets cannot be loaded. Therefore, this alternative method is better. /cc @webfansplz

webfansplz commented 4 months ago

We need to test some use cases for platforms like Laravel and WXT. If it works on these platforms, we can push it forward.

alexzhang1030 commented 4 months ago

We need to test some use cases for platforms like Laravel and WXT. If it works on these platforms, we can push it forward.

I have tested it, it's working as usual.

webfansplz commented 4 months ago

The vite internal implementation of direct load assets by absolute path is here, it called a function isFileServingAllowed to check the ability. But there are some limitations when using this way to load devtools assets, like if we set server.fs.strict to true, devtools assets cannot be loaded. Therefore, this alternative method is better. /cc @webfansplz

We can comment on the details in the codebase. like: https://github.com/webfansplz/vite-plugin-vue-inspector/blob/main/packages/core/src/index.ts#L184C14-L184C83