Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rslib features track #46

Open
59 of 82 tasks
Timeless0911 opened this issue Jul 26, 2024 · 2 comments
Open
59 of 82 tasks

Rslib features track #46

Timeless0911 opened this issue Jul 26, 2024 · 2 comments

Comments

@Timeless0911
Copy link
Collaborator

Timeless0911 commented Jul 26, 2024

CLI

Config

  • Provide preset templates to default set some common configs for basic scenes
  • Support better shared Rsbuild config

Features

We try to keep the features aligned with Modern.js Module

bundle / bundleless

  • basic support

format

output.library.type

  • cjs
  • esm
  • umd
  • mf

platform

  • support output.target
  • support control the syntax target for downgration

alias

autoExtension

  • js extension
    • .js with esm format and .cjs with cjs format when type: module
    • .js with cjs format and .mjs with esm format when type: commonjs
  • dts extension
    • .d.ts with esm format and .d.cts with cjs format when type: module
    • .d.ts with cjs format and .d.mts with esm format when type: commonjs

externals

output.externals

  • prevent externalizing entry modules in bundleless mode
  • make node built-in modules external when target is node
  • support auto external dependencies and peerDependencies
  • support tools.swc to external helpers

redirect

  • redirect in js outputs of bundleless mode
    • alias
    • extensions (import/export)
    • css
    • asset path
  • redirect in DTS outputs of bundleless mode
    • alias

shims

  • shims __filename and __dirname in esm
  • shims import.meta.url in cjs
  • set module.parser.javascript.importMeta = false in esm

banner & footer

  • integrate banner-plugin to inject content
  • support inject in dts files

dts

  • support cleanDistPath to clean DTS output before emit
  • use ts compiler API to generate bundleless dts
    • watch api in watch mode
    • incremental build with project reference
  • use api-extractor to generate dts bundle
    • auto external packages
  • optimize log output and error handler
  • support autoExtension for dts files
  • support abortOnError option to control whether to exit process when dts build error
  • support generate dts when isolatedDeclarations enabled

css

Module Federation

input

copy

define

minify

outDir

resolve

sourcemap

transformImport

decorators

asset

polyfill

  • node polyfill
  • polyfill with core-js-pure

prebundle

  • like what ncc do

Ecosystem

  • Storybook integration
  • Support using Rspress to build a static site for module doc
  • Monorepo development with fast one-time HMR
  • Simple bump and publish workflow
  • Vue component support

Advanced

  • JS API
  • Zero-config use and related config check

Migration

  • Config map between Rslib and Modern.js Module
  • Migrate E2E test cases from Modern.js Module
  • performance benchmark with other tools
  • Adding integration tests about using Rsbuild to bundle packages built by Rslib
@yee94
Copy link

yee94 commented Aug 20, 2024

Usually this kind of tools need extends options, don't you think?

@Timeless0911
Copy link
Collaborator Author

Usually this kind of tools need extends options, don't you think?

Can you give some examples of what extends is going to do?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants