# Debugging @pitcher/core module
In this part, we will present how to debug @pitcher/core
module in a consumer application. There are multiple options to debug core
package.
# Option 1: Live debugging (recommended)
This approach is highly recommended as you can immediately see the effects of your changes inside the consumer project and rely on the results.
To start debugging core
package inside your application:
- Open
node_modules/@pitcher/core/package.json
file - Find
main
andmodule
keys, change both values tosrc/index.js
- Debug/Change anyting inside
node_modules/@pitcher/core/src
package to see effects live - 🎉 Send a pull request with your changes to
pitcher-js-platform
repository
NOTE
Do not forget to change back main
and module
entries to it is original values. Or simply just re-install the package with
npm install @pitcher/core@latest
# Option 2: Linking the package
This approach might not always work properly, as linking has a strange behaviour in some cases.
To start debugging core
package with linking:
- Clone
pitcher-js-platform
repository - Install dependencies with running
yarn install
in the root directory of the project - After installing the dependencies, go to the core package folder in the command line with
cd packages/core
- In this path, simply run
yarn link
, note the package name here (@pitcher/core
) - Then go to your project that uses the core package, open a command line
- Then run
yarn link @pitcher/core
. NOTE that you might need to uninstall@pitcher/core
package from your project first
More about linking exist in Yarn documentation (opens new window)
NOTE
To reverse this process, simply use yarn unlink or yarn unlink [package]