https://github.com/codex-team/hawk.vite.plugin
JS errors tracking with Vite
https://github.com/codex-team/hawk.vite.plugin
error-monitoring hawk
Last synced: 4 months ago
JSON representation
JS errors tracking with Vite
- Host: GitHub
- URL: https://github.com/codex-team/hawk.vite.plugin
- Owner: codex-team
- Created: 2022-07-31T14:09:15.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-08T15:19:20.000Z (over 1 year ago)
- Last Synced: 2024-04-23T22:09:30.590Z (about 1 year ago)
- Topics: error-monitoring, hawk
- Language: JavaScript
- Homepage: https://hawk.so
- Size: 806 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hawk Vite Plugin
Vite plugin for sending releases with sourcemaps to Hawk.
## Install
```shell
yarn add @hawk.so/vite-plugin -D
```## Connect
Include the plugin to the plugins list of `vite.config` file
```js
import hawkVitePlugin from '@hawk.so/vite-plugin';export default defineConfig({
plugins: [
...,
hawkVitePlugin({
token: '' // Your project's Integration Token
})
]
})
```### Plugin options
| name | type | required | description |
| -- | -- | -- | -- |
| `token` | string | **required** | Your project's Integration Token |
| `release` | string/number | optional | Unique identifier of the release. Used for source map consuming (see below) |
| `removeSourceMaps` | boolean | optional | Shows if the plugin should remove emitted source map files. Default is `true` |
| `collectorEndpoint` | string | optional | Sourcemaps collector endpoint overwrite |### Connect Release to JavaScript catcher
After plugin finish its work, it will export release information to the global scope.
You can access release identifier via `window.HAWK_RELEASE` in browser and `global.HAWK_RELEASE` in NodeJS and pass this data to the JavaScript Catcher on initialization.#### TypeScript
To make TypeScript see typings for `window.HAWK_RELEASE` and `global.HAWK_RELEASE` add their declaration in your "tsconfig.json"
```json
{
"compilerOptions" : {
"types": {
"@hawk.so/vite-plugin/global"
}
}
}
```