Skip to content

[Feature]: named config and positive filter #382

@xc2

Description

@xc2

What problem does this feature solve?

To build with specific lib configs (aka environment) only. For example, a library has 5 lib configs:

  1. esm build with modern syntax
  2. cjs build with modern syntax
  3. esm build with legacy syntax
  4. dts build
  5. other package files

and only 1 or 2 is useful for development/test. we can filter out the others

What does the proposed API look like?

Rslib Config

{
  "lib": [
    { "name": "x", ... },
    { "name": "y", ... },
    { "name": "z", ... },
    { ... },
    { ... },
  ]
}

Rslib CLI

--only x --only y
--only x,y

Rsbuild

createRsbuild({
  rsbuildConfig: {
    environments: {
      x: { ... },
      y: { ... },
      z: { ... },
      esm0: { ... },
      esm1: { ... },
    }
  },
  environment: args.only
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions