npm packs node_modules in random subdirectory

36 Views Asked by At

I am working on a project that requires me to have package.json files in subdirectories with their own node_modules folders (kind of like a monorepo).

When I run npm pack to see what gets published I see a seemingly random node_modules folder get bundled when no other node_modules folder gets bundled.

To reproduce:

  1. git clone https://github.com/wathhr/create-theme
  2. Install deps in all required subdirectories (or run the updateDeps script)
  3. npm pack
  4. Look at the .tgz file, no directory will have the node_modules folder other than templates/languages/css

I have tried adding "bundleDependencies": false to my package.json (as mentioned here) to no avail.

0

There are 0 best solutions below