@hawk.so/vite-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Hawk Vite Plugin

Vite plugin for sending releases with sourcemaps to Hawk.

Install

yarn add @hawk.so/vite-plugin -D

Connect

Include the plugin to the plugins list of vite.config file

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"

{
  "compilerOptions" : {
    "types": {
      "@hawk.so/vite-plugin/global"
    }
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @hawk.so/vite-plugin

Weekly Downloads

48

Version

1.0.6

License

MIT

Unpacked Size

10 kB

Total Files

9

Last publish

Collaborators

  • codex-team