-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add hawk integration * Fix eslint errors * Rewrite to plugin
- Loading branch information
1 parent
c21c0df
commit f617aec
Showing
6 changed files
with
129 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { App } from 'vue'; | ||
import HawkCatcher from '@hawk.so/javascript'; | ||
|
||
declare global { | ||
interface Window { | ||
/** | ||
* Release id added by hawk-vite-plugin | ||
*/ | ||
HAWK_RELEASE: string; | ||
} | ||
} | ||
|
||
/** | ||
* Vue app plugin that initializes Hawk error catcher | ||
*/ | ||
const HawkPlugin = { | ||
install(app: App) { | ||
new HawkCatcher({ | ||
token: import.meta.env.VITE_HAWK_TOKEN, | ||
vue: app, | ||
release: window.HAWK_RELEASE, | ||
}); | ||
}, | ||
}; | ||
|
||
export default HawkPlugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
import { defineConfig } from 'vite'; | ||
import { defineConfig, loadEnv } from 'vite'; | ||
import vue from '@vitejs/plugin-vue'; | ||
export default defineConfig({ | ||
plugins: [vue()], | ||
resolve: { | ||
alias: { | ||
/* eslint-disable-next-line @typescript-eslint/naming-convention */ | ||
'@/': '/src/', | ||
import hawkVitePlugin from '@hawk.so/vite-plugin'; | ||
|
||
export default defineConfig(({ mode }) => { | ||
const env = loadEnv(mode, process.cwd()); | ||
|
||
return { | ||
plugins: [ | ||
vue(), | ||
hawkVitePlugin({ | ||
token: env.VITE_HAWK_TOKEN, | ||
}), | ||
], | ||
resolve: { | ||
alias: { | ||
/* eslint-disable-next-line @typescript-eslint/naming-convention */ | ||
'@/': '/src/', | ||
}, | ||
}, | ||
}, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters