include
Package: @autotracer/plugin-vite-react18 · Layer: Build · Type: object · Default: see below
include is a build configuration option for reactTracer.vite() — the Vite plugin initializer of the @autotracer/plugin-vite-react18 React build-time injection package. It defines which files and component names are eligible for injection before pragma comments are evaluated.
paths uses glob patterns relative to the project root. components accepts exact names, glob-like strings, or regular expressions.
This option is deep-merged with the plugin defaults. If you provide only components, the default paths value is kept.
By default, the plugin considers every .tsx and .jsx file eligible and applies no component-name filter. include is the setting you use when that default eligible set is too broad.
Read together with exclude and mode when you are narrowing the eligible set.
Default
{
paths: ["**/*.{tsx,jsx}"],
components: [],
}In the default "opt-out" mode, that means most React component files start eligible unless another setting removes them.
How Eligibility Works
excluderemoves files beforeincludeis checked.include.pathsdecides which remaining files are eligible for transformation.include.componentsandexclude.componentsdecide which component names inside those eligible files can still be instrumented.- Pragma comments such as
@traceand@trace-disablerun only inside that eligible set.@tracecannot bypass anincludemiss or an explicitexcludematch.
Fields
pathsfilters which files are considered for transformation.componentsfilters which component names inside eligible files can be instrumented.
Usage
reactTracer.vite({
include: {
paths: ["src/**/*.tsx", "app/**/*.tsx"],
components: ["App", "User*", /^Dashboard/],
},
});