falstack / vite-plugin-host

vite plugin to support change dev domain
MIT License
14 stars 0 forks source link

Unfortunately, no details #1

Open neoighodaro opened 2 years ago

neoighodaro commented 2 years ago

Hey,

First thanks for this. I assume it solves the issue I am also having which is about using a custom domain for my development in Vite JS. However, theres no explanation on how to use it. I mean i tried adding the host to the plugins list but this did nothing to help me.

xiaweiss commented 2 years ago

I don‘t understand too,maybe you can see: https://www.npmjs.com/package/dev-ip

neoighodaro commented 2 years ago

I was able to make vite work using custom domains without this package, here's my config:

{
  // ...
  server: {
    host: 'example.test',
    origin: 'https://example.test/',
    hmr: {
      host: 'example.test',
      port: 443,
    },
  },

  // ...
}
falstack commented 2 years ago

@neoighodaro thanks feedback, do you want to customize these parameters?

neoighodaro commented 2 years ago

@neoighodaro thanks feedback, do you want to customize these parameters?

Hey thanks for the response.

What parameters? I just wanted to support custom domains in my dev environment but the plugin did not work after following the readme.

ctholho commented 2 years ago

Hi, I have the same problem. Can you please expand on the readme?

rossPatton commented 2 years ago

same. if anyone has any help to offer - nothing works. i just get a failed websocket connection that just reloads the page infinitely

neoighodaro commented 2 years ago

@rossPatton did you see my comment? Mine works fine now without any plugin

fatgy commented 2 years ago

My config is work

Create cert by mkcert

mkcert -key-file ./.cert/key.pem -cert-file ./.cert/cert.pem "my-vite-app.test"
{
  server: {
    https: {
      key: "./.cert/key.pem",
      cert: "./.cert/cert.pem"
    },
    host: "my-vite-app.test",
    origin: "https://my-vite-app.test"
  }
}
rossPatton commented 2 years ago

@rossPatton did you see my comment? Mine works fine now without any plugin

Sorry, it's been a minute but iirc I tried your config and it didn't work for me. I think the next time I take a pass at this I might try fatgy's approach maybe?

fatgy commented 2 years ago

Do you add the /etc/host (MacOS) for 127.0.0.0 example.test?

On Wed, Sep 14, 2022 at 12:37 AM Aaron Hardy @.***> wrote:

None of these solutions seem to work for me. I get:

@thing/thing:dev: WebSocket server error: @thing/thing:dev: Error: getaddrinfo ENOTFOUND example.test @thing/thing:dev: at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:111:26) @thing/thing:dev: error when starting dev server: @thing/thing:dev: Error: getaddrinfo ENOTFOUND example.test @thing/thing:dev: at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:111:26)

for @neoighodaro https://github.com/neoighodaro's solution and a similar one for @fatgy https://github.com/fatgy's.

— Reply to this email directly, view it on GitHub https://github.com/falstack/vite-plugin-host/issues/1#issuecomment-1245730654, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACWMFOCUE7NHI4SPBDSZILV6C3WTANCNFSM5IHJG4JA . You are receiving this because you were mentioned.Message ID: @.***>