3

I have a package A that depends on package B. I am using yalc to update B and publish changes locally so that A can pick up these changes.

I can see that the changes are copied into A's node_modules folder, however webpack doesn't seem to pick them up. When running A in a dev server, I still see the old code. Restarting the dev server doesn't help. Even yarn install --check-files doesn't help. The only thing that helps is nuking the whole node_modules and reinstalling.

Project A was creates with create-react-app

package.json has the following:

dependencies: {
...
@company_name/project_name: "file:.yalc@company_name/project_name"
... }

I am using yarn 1.22

Rodion Degtyar
  • 238
  • 2
  • 7

2 Answers2

5

tl;dr

yalc push --sig

Explanation

Webpack caches, aggressively, modules based on the package.json version

Changing the version number, rebuilding and running yalc push, which does trigger an immediate rebuild in webpack-dev-server.

yalc push and yalc publish support a --sig option, which adds the current build signature to the deployed packages' version numbers.

Jamie Rumbelow
  • 4,967
  • 2
  • 30
  • 42
0

In case of an angular project, you can delete the following folder: .angular/cache This will cause webpack to rebuild the node_modules folder. The .angular/cache folder is a hidden folder in the root of your project.

Kurt Van den Branden
  • 11,995
  • 10
  • 76
  • 85