4

I'm building 2 npm packages that are dependent.

Module A (package.json)

"dependencies": {
  "module-b":"~0.0.1"
}

We use npm link to connect these two apps locally. Currently we need to run npm run prepublish on module-b to visualise the changes on module-a while running webpack dev server on module-a

Question: Is it possible for us to have hot reloading between the two modules. Like any changes made on Module B will reflect automatically on ModuleA?

Prasanna
  • 10,956
  • 2
  • 28
  • 40

1 Answers1

0

I couldn't find proper solution as well. However, I use a workaround which work very decent.

I created a bash script which run npm build for module b and then npm build & npm start for module a and point nodemon to watch for changes in module b and trigger the bash script.

Other possible solution is to work directly in node_modules/module b and set webpack to watch node_modules/module b see https://webpack.js.org/configuration/watch/

xargr
  • 2,788
  • 1
  • 19
  • 28