jgoz / esbuild-plugins

My esbuild plugins monorepo
MIT License
40 stars 4 forks source link

@jgoz/esbuild-plugin-livereload parameter to accept external connections #115

Closed KurtPreston closed 5 months ago

KurtPreston commented 5 months ago

Attempt at fixing issue #114.

I was uncertain how to go about testing the changes, however, I did verify that setting host to 0.0.0.0 in packages/esbuild-plugin-livereload/src/server.ts does fix the issue for me.

This PR adds an option that sets the server host to 0.0.0.0, while preserving the host value that determines where the script is fetched from.

changeset-bot[bot] commented 5 months ago

⚠️ No Changeset found

Latest commit: 37ddf552e7cabdebc282fcb015ea7e2c42797d35

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

jgoz commented 5 months ago

@KurtPreston Thanks for submitting this, but I think it might be unnecessary. There is already a host option that you set to 0.0.0.0 directly: https://github.com/jgoz/esbuild-plugins/tree/master/packages/esbuild-plugin-livereload#function-livereloadpluginoptions-livereloadpluginoptions-plugin

Can you give that a try and let me know if it works?

jgoz commented 5 months ago

Closing in favor of b23f695f5c05e1877f06043bcaef861a4a7170dc. Thanks again for contributing