π Usage Example
This page shows advanced usage for mostir.config.mjs.
Setting up Configβ
You donβt need to run mostir init to create a fresh mostir.config.mjs every time.
Instead, just copy one from another project (or a template) and tweak the settings for your case.
Example
- mostir Github Repository, mostir itself is built with mostir build, using its own config.
Using glob patterns with fast-globβ
By default, you can pass a glob string directly to entryPoints.
For more advanced filtering, you can use fast-glob to resolve entry points manually.
// mostir.config.mjs
import fg from "fast-glob";
const ignore = ["**/*.test.ts", "**/__tests__/**", "**/*.d.ts"];
// alternatively, resolve entry points with fast-glob for advanced filtering
const entryPoints = await fg("src/**/*.ts", {
cwd: process.cwd(),
absolute: true,
onlyFiles: true,
ignore,
});
export default {
build: {
entryPoints,
outdir: "dist",
bundle: false,
platform: "node",
target: "esnext",
format: "esm",
logLevel: "info",
outbase: "src",
metafile: true,
},
ignore,
};
Notesβ
- Use
absolute: truewith fast-glob to ensure esbuild receives fully resolved paths. - The
ignorearray can be reused for bothfast-globand theignoreoption inmostir. ignorepattern is useful if you want fine-grained control over which files to include/exclude (especially in monorepo setups).