We have implemented contract testing using pact for our Angular JS frontends and java backends.
I've noticed that the node_modules/@pact-foundation directory is pretty huge (pact-node v 4.3.2)
du -sh node_modules/@pact-foundation/
741M node_modules/@pact-foundation/
The JS UIs are always only consumers but the dependencies seem to require the following
ls node_modules/@pact-foundation/
pact-mock-service pact-node pact-provider-verifier-linux-x64
pact-mock-service-linux-x64 pact-provider-verifier
Is there any way to pull in a smaller set of dependencies?
Edit - it seems the reason for this is as follows
du -sh pact-node/node_modules/@pact-foundation/pact-mock-service/build/*
1.9M pact-node/node_modules/@pact-foundation/pact-mock-service/build/pact-mock_service-0.8.2
8.9M pact-node/node_modules/@pact-foundation/pact-mock-service/build/pact-mock-service-0.8.2-1-linux-x86_64.tar.gz
8.5M pact-node/node_modules/@pact-foundation/pact-mock-service/build/pact-mock-service-0.8.2-1-linux-x86.tar.gz
9.2M pact-node/node_modules/@pact-foundation/pact-mock-service/build/pact-mock-service-0.8.2-1-osx.tar.gz
12M pact-node/node_modules/@pact-foundation/pact-mock-service/build/pact-mock-service-0.8.2-1-win32.zip
50M pact-node/node_modules/@pact-foundation/pact-mock-service/build/pact-mock-service-darwin
48M pact-node/node_modules/@pact-foundation/pact-mock-service/build/pact-mock-service-linux-ia32
50M pact-node/node_modules/@pact-foundation/pact-mock-service/build/pact-mock-service-linux-x64
51M pact-node/node_modules/@pact-foundation/pact-mock-service/build/pact-mock-service-win32
pact-node depends on pact-mock-service & the bundled dependency includes the mock service for all OSes.
Edit 2 -
Changing my dependency to the following
"@pact-foundation/pact-node": "6.9.0",
and adding a resolution (I'm using yarn not npm)
"resolutions": {
"@pact-foundation/pact-node": "6.9.0"
}
Brings the total size of the dependencies down to
du -sh node_modules/@pact-foundation/*
1.7M node_modules/@pact-foundation/pact-node
170M node_modules/@pact-foundation/pact-standalone
Cheers Shane