Closed kirill-kruchkov closed 2 years ago
Thanks for the contribution! It looks like it will, but just confirming, will this change work fine on older versions of next?
Hello @BRKalow! I think it should, but let me test it again in the evening.
@BRKalow I created a separate branch that includes this change while using Next v10. I haven't noticed anything unusual, but I'm not familiar well enough with all the test cases (there're 4 test scripts in the package.json). Would be great if someone could double check it: https://github.com/kirill-kruchkov/next-remote-watch/tree/test/next-10.
Also, I realised that this repo uses npm (I used yarn at first), so I updated this PR accordingly (dropped yarn.lock
and updated package-lock.json
).
NextJS v12 requires a
hostname
andport
to be provided for the custom server when a middleware is used in the project (https://nextjs.org/docs/advanced-features/custom-server). Updating NextJS breaks such a project's dev server, if it usesnext-remote-watch@1.0.0
. Here's an example:This PR updates NextJS as a devDependency (not a peerDependency) of
next-remote-watch
and addresses the aforementioned issue by:HOSTNAME
alongside thePORT
from env variables.localhost
).next(...)
options.It also adds a middleware to test this behaviour.