Metronome Vite Plugin Configuration

Metronome has a few configurations that can help you track only what you need. In vite, instead of using a config file, you can pass the configuration as a plugin option.
MetronomeConfig interface
export interface MetronomeConfig {
endpoint?: string | null;
apiKey?: string | null;
ignoredRoutes?: (string | RegExp)[];
ignoredPathnames?: (string | RegExp)[];
unstable_sourceMaps?: boolean;
debug?: boolean;
}

Config Properties

PropertyTypeDefault Value
endpoint
string
apiKey*
string
ignoredRoutes
(string | RegExp)[]
ignoredPathnames
(string | RegExp)[]
["/healthcheck"]
unstable_sourceMaps
boolean
false
debug
boolean
false

Usage

vite.config.js
// ...
export default defineConfig({
plugins: [
remix(),
tsconfigPaths(),
metronome({
// The endpoint prop is not needed if you're using Metronome Cloud
endpoint: "https://metronome.example.com",
ignoredPathnames: ["/healthcheck", /^\/tasks\/.*/],
ignoredRoutes: ["root"],
}),
],
});

endpoint

This property controls the endpoint that Metronome will use to send the data in case you're self-hosting Metronome. If not set, Metronome will send the data to Metronome Cloud instead.

ignoredPathnames

This property controls the pathnames that will be ignored. Metronome will ignore all loaders and actions that are equal or match the pathname regex.

ignoredRoutes

This property controls the route ids that will be ignored. Metronome will ignore all loaders and actions that are equal or match the route name.

unstable_sourceMaps

This property controls whether Metronome will send source maps to the server or not. This is useful when you're debugging your application and want to see the original source code in the Metronome dashboard.

debug

This property controls whether Metronome will log debug information to the console or not.