mirror of
https://github.com/robbevp/vite-plugin-fathom.git
synced 2026-07-03 18:46:10 +02:00
No description
- TypeScript 87.3%
- JavaScript 12.7%
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|---|---|---|
| .github | ||
| src | ||
| .gitignore | ||
| eslint.config.js | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
| yarn.lock | ||
vite-plugin-fathom
A small vite plugin to inject the fathom script on your html page.
Usage
Add the plugin to your vite config. The fathom site id will be loaded from the VITE_FATHOM_ID environment variable by default.
// vite.config.js
import { defineConfig } from "vite";
import vitePluginFathom from "vite-plugin-fathom"
export default defineConfig({
plugins: [vitePluginFathom()],
});
If your want, you can specify the site ID and options:
// vite.config.js
import { defineConfig } from "vite";
import vitePluginFathom from "vite-plugin-fathom"
export default defineConfig({
plugins: [vitePluginFathom("ABCDEF", { forceEU: true })],
});
If the site id isn't passed as an argument or the environment variable is not set, the script will not be added to the head.
Options
| Option | Type | Default |
|---|---|---|
| forceEU | boolean |
false |
| spa | boolean or string |
"auto" |
| honorDNT | boolean |
false |
| autoTrack | boolean |
false |
| ignoreCanonical | boolean |
false |
For an explanation of these settings, see fathom's documentation.