webfansplz / vite-plugin-vue-inspector

jump to editor source code while click the element of browser automatically.
MIT License
697 stars 74 forks source link

support reverse proxies #27

Closed frank-swp closed 1 year ago

frank-swp commented 2 years ago

hi, we really liked your plugin and wanted do use it in our setup.

We are using devspace for development, which we use to setup a reverse-proxy and development container with our application.

The application container is running under port 80 (http) and on localhost. vite.config.ts:

    server: {
        host: true,
        port: 80,
        open: 'https://mengencloud.swp.localhost:8443',
    },

The nginx reverse proxy is running on https://mengencloud.swp.localhost:8443

This leads to the following error: image

The inspector uses the (wrong) port from the vite.config.ts and not from import.meta.url.

This pull-request uses the import.meta.url in a browser-context and ignores any other urls from vite. Which works for us, but leads maybe to problems in other use-cases.

We would like to know how a fix like this could be integrated into vite-plugin-vue-inspector.

webfansplz commented 2 years ago

Now the configuration is to satisfy #17 ,Maybe there's a better way to compatible with it ?

frank-swp commented 2 years ago

I don't understand the problem for #17 completely, but might it be an option to provide an explicit config option (baseUrl). There might be a lot more use cases where it is something special.

The user could set it to the same values like he uses in vite.config.ts if that is what he wants, or something else if required. This relates also to #19.

webfansplz commented 2 years ago

I don't understand the problem for #17 completely, but might it be an option to provide an explicit config option (baseUrl). There might be a lot more use cases where it is something special.

The user could set it to the same values like he uses in vite.config.ts if that is what he wants, or something else if required. This relates also to #19.

Sure,PR Welcome.