Configuring Metronome
Metronome has a few configurations that can help you track only what you need. Themetronome.config.js
Default Config file
When you runmetronome init
metronome.config.js
metronome.config.js
/**
* @type {import('@metronome-sh/config').MetronomeConfig}
*/
module.exports = {
ignoredRoutes: [],
ignoredPathnames: ["/healthcheck"],
ignoreHeadMethod: true,
};
Config Properties
Property | Type | Default Value |
---|---|---|
ignoredRoutes | (string | RegExp)[] | |
ignoredPathnames | (string | RegExp)[] | ["/healthcheck"] |
ignoreHeadMethod | boolean | true |
ignoredRoutes
This property controls the routes that will be ignored by the Metronome. Metronome will ignore all loaders and actions that match the route.metronome.config.js
/**
* @type {import('@metronome-sh/config').MetronomeConfig}
*/
module.exports = {
// Ignores the root route
ignoredRoutes: ["root"],
ignoredPathnames: ["/healthcheck"],
ignoreHeadMethod: true,
};
root
ignoredPathnames
This property controls the pathnames that will be ignored. Metronome will ignore all loaders and actions that match the pathname.metronome.config.js
/**
* @type {import('@metronome-sh/config').MetronomeConfig}
*/
module.exports = {
ignoredRoutes: [],
// Ignores the healthcheck and all loaders and actions
// that contains "tasks" in the pathname
ignoredPathnames: ["/healthcheck", /^\/tasks\/.*/],
ignoreHeadMethod: true,
};
healthcheck.tsx
tasks.tsx
tasks.$taskId.tsx
/healthcheck
/tasks/123
/tasks
ignoreHeadMethod
This property controls if theHEAD
metronome.config.js
/**
* @type {import('@metronome-sh/config').MetronomeConfig}
*/
module.exports = {
ignoredRoutes: [],
ignoredPathnames: ["/healthcheck"],
// Tracks the HEAD method
ignoreHeadMethod: true,
};