diff --git a/packages/grafana-toolkit/README.md b/packages/grafana-toolkit/README.md index a1da1ee4689..8b853ac6b41 100644 --- a/packages/grafana-toolkit/README.md +++ b/packages/grafana-toolkit/README.md @@ -336,7 +336,19 @@ You can contribute to grafana-toolkit by helping develop it or by debugging it. ### Develop grafana-toolkit -Typically plugins should be developed using the `@grafana/toolkit` installed from npm. However, when working on the toolkit, you might want to use the local version. Follow the steps below to develop with a local version: +Typically plugins should be developed using the `@grafana/toolkit` installed from npm. However, when working on the toolkit, you might want to use the local version. There are two ways to run the local toolkit version: + +### Using `NODE_OPTIONS` to load the yarn pnp file: + +You can run grafana toolkit directly from the grafana repository with this command. + +`NODE_OPTIONS="--require $GRAFANA_REPO/.pnp.cjs" $GRAFANA_REPO/packages/grafana-toolkit/dist/bin/grafana-toolkit.js [command]` + +You can replace `$GRAFANA_REPO` with the path to your grafana clone or set it in your environment. e.g.: `export GRAFANA_REPO=/home/dev/your_grafana_clone` + +> Note: This will run grafana toolkit from your local clone but it won't change the dependencies of what you are trying to build. + +### Using yarn berry linking. #### Prerequisites