Grafana/toolkit: Update README.md to include an alternative way to run local grafana/toolkit (#54203)

* Update README.md

* Run prettier
This commit is contained in:
Esteban Beltran 2022-09-02 17:49:39 +02:00 committed by GitHub
parent f4a35a4645
commit 4bba3223a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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