@logfrog/cli
v0.1.0
Published
Build and upload private JavaScript source maps to Logfrog.
Readme
Logfrog CLI
Build a React app with private production source maps and upload them to the selected Logfrog project.
Install
npm install --global @logfrog/cli
logfrog loginLogin opens Logfrog in your browser, asks which projects the CLI may access, and stores refreshable credentials in ~/.config/logfrog/config.json with user-only permissions. Passwords never pass through the CLI.
Vite / React
Make the runtime release use the value injected by the CLI:
logfrog.init({
release: import.meta.env.VITE_LOGFROG_RELEASE,
features: { updates: true, feedback: true },
});Then run this from the React repository:
logfrog uploadFor Vite, the CLI runs the existing build script with --sourcemap hidden. It also supports Create React App and existing generic JavaScript source maps. The default release is <package-version>-<git-sha>.
Useful options:
logfrog projects
logfrog use "My project"
logfrog upload --release 2.4.0-abc123
logfrog upload --no-build --dir dist
logfrog upload --delete-after-upload
logfrog upload --dry-run--delete-after-upload removes only the .map files that were successfully uploaded. Use it when the build directory is deployed directly and maps should not be published.
For CI, run logfrog login once in a protected environment and preserve the CLI config directory as a secret, or set LOGFROG_CONFIG_DIR to a protected mounted directory.
