rslib icon indicating copy to clipboard operation
rslib copied to clipboard

[Feature]: Zero-Configuration Rslib

Open colinaaa opened this issue 1 year ago • 1 comments

What problem does this feature solve?

Tools like pkgroll and microbundle offer zero-configuration support. It would be great if Rslib also supports using with zero-configuration.

What does the proposed API look like?

Rslib can be run without rslib.config.ts. Most of the configuration can be read from package.json.

  • Read entry from main, module, umd and exports
  • Read externals from dependencies, devDependencies and peerDependencies
  • Read alias from package.json#imports

Or, maybe create a new tool Rspkg that uses Rslib with zero-configuration.

colinaaa avatar Aug 06 '24 04:08 colinaaa

Yeah! Using package.json as the single source of truth is in plan. Rslib also should check the correctness with it when providing a rslib.config file. We may support autoExternal at first (tracked in https://github.com/web-infra-dev/rslib/issues/46).

fi3ework avatar Aug 06 '24 04:08 fi3ework