Skip to content
LogoLogo

Ignore files

Oxcruise has four ways to control which modules are in the graph.

WayEffect
.gitignoreOxcruise uses the rules of .gitignore files when it looks for modules. A module that another module imports stays in the graph, also when .gitignore lists it.
ignorePatternsModules that match the globs are not part of the graph.
doNotFollowModules that match the globs stay in the graph. Oxcruise does not parse their imports.
--max-depthOxcruise follows dependencies at most N hops from the entries.

ignorePatterns

export default defineConfig({
  ignorePatterns: ["src/generated/**", "**/*.stories.tsx"],
});

Use --ignore-pattern <GLOB> to add globs for one run. Repeat the flag for more globs.

npx oxcruise --ignore-pattern "**/*.test.ts" --ignore-pattern "src/legacy/**"

A module that Oxcruise leaves out is not in the graph. No rule and no output sees it.

doNotFollow

Use doNotFollow for a module that you want to see in the graph, but whose imports do not matter.

export default defineConfig({
  doNotFollow: ["**/*.spec.ts"],
});

Files in node_modules always behave in this way: they are in the graph as leaves.

--max-depth

npx oxcruise --max-depth 2

Oxcruise measures the depth of a module as the smallest number of hops from an entry. A module that a long path reaches first is still explored when a shorter path appears. Modules deeper than the limit are not in the graph, so no output or rule sees them.

Globs

All of these keys use globs with *, **, ?, [ab] and {a,b}. A leading ! negates a glob.