Hello - I’m working on a npm package locally and often like to test it within a development nextjs site. I use yalc when building locally, but have also tried yarn link in the past and happy to go back to that if someone thinks that’d fix the issue:
The issue in steps:
-
I build the package locally. Code within node modules is correctly updated.
-
I run next dev, package works as expected.
-
I make an update to the package and rebuild. Code within node modules is correctly updated.
-
The rebuild is successful, but the next dev site does not use the updated code - it’s cached somewhere in the .next folder.
-
I have to stop next dev, delete the .next folder, then restart the next dev server. Changes made in step 3 finally show up.
Step 5 is a huge pain because it’s slow and requires manual intervention. What should I be doing differently so I can have the latest changes automatically reloaded within the next dev process without killing it and deleting .next?
Thanks!