unbuild
unbuild copied to clipboard
export `inferEntries` in `src/index`
Describe the feature
Hi~ I want to reuse the auto-inferred build entries in build.config.ts, and then make some changes on this basis. I don't know if it can be implemented?
Additional information
- [x] Would you be willing to help implement this feature?
import { defineBuildConfig } from "unbuild";
export default defineBuildConfig({
entries: ["src/index.ts"],
outDir: "dist",
declaration: true,
hooks: {
'build:before'(ctx) {
// ↓ You mean this? (Or other hooks)
console.log('ctx.options.entries', ctx.options.entries)
// =>
// [
// {
// input: '/.../examples/1.zero-config/src/index.ts',
// name: 'index',
// builder: 'rollup',
// declaration: true,
// outDir: '/.../examples/1.zero-config/dist'
// }
// ...
// ]
}
}
});