@lerix-dev/lerix-cli
v0.1.1
Published
Lerix command line tool. `npx @lerix-dev/lerix-cli upload` uploads your web build's source maps so Lerix shows errors at the exact file and line of your original code.
Maintainers
Readme
@lerix-dev/lerix-cli
The Lerix command line tool. Upload your web build's source maps so Lerix shows production errors at the exact file and line of your original code, without deploying your source maps publicly.
npx @lerix-dev/lerix-cli uploadRun it after your build and before you deploy. From your project folder it:
- finds the build output (Angular's
outputPathinangular.json, then.next,build/web,dist,build,out), - uses the
versioninpubspec.yamlorpackage.jsonas the release, - uploads every
*.js.mapfile, then deletes them from the build so they are never deployed.
Or install it once and let every build upload on its own:
npm install --save-dev @lerix-dev/lerix-cli"scripts": {
"postbuild": "lerix upload --optional"
}--optional keeps local builds working: without LERIX_SECRET_KEY (a developer's
machine) the upload is skipped instead of failing the build, and the .map files
are still deleted. pnpm and Yarn 2+ don't run postbuild; chain it in build
instead ("build": "ng build && lerix upload --optional").
Set your keys as environment variables:
| Variable | Value |
|---|---|
| LERIX_API_KEY | Your project API key |
| LERIX_PROJECT_ID | Your project ID |
| LERIX_SECRET_KEY | A private API key with the Upload source maps permission (Project settings → API keys) |
Pass the same release to the SDK (release in provideLerix() / LerixProvider options,
or NEXT_PUBLIC_LERIX_RELEASE for Next.js).
Options
lerix upload [build-dir] [--release <version>] [--optional] [--keep-maps] [--dry-run]--api-key, --project-id, --secret-key, --url and --release override the
LERIX_* environment variables. Run npx @lerix-dev/lerix-cli --help for details.
Docs: https://docs.lerix.dev/modules/error-tracking#source-maps
