Skip to content

[Feature]: expose stats result for build command by js api #1040

@XGHeaven

Description

@XGHeaven

What problem does this feature solve?

Rsilb has build js api. But cannot get compiled stats object for returned instance after first compiled.
I tried onAfterBuild hook is still not works.

import { build } from '@rslib/core'

const instance = await build(/*..., config and options*/)

instance.stats // undefined
instance.onAfterBuild(options => {
  // not called when first compiled
})

What does the proposed API look like?

instance.stats // is a object
// or
instance.onAfterBuild(options => {
  // should called when first compiled
})

It's better to expose stats for buildInstance or allow developer to register hook before run rsbuildInstance.build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions