Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rslib features track #46

Open
64 of 87 tasks
Timeless0911 opened this issue Jul 26, 2024 · 6 comments
Open
64 of 87 tasks

Rslib features track #46

Timeless0911 opened this issue Jul 26, 2024 · 6 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
    • path
    • extension (import/export)
    • style
    • asset path
  • redirect in DTS outputs of bundleless mode
    • path
    • extension

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

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?

@lanmingle
Copy link

lanmingle commented Nov 15, 2024

突然说 Modern.js Module 不推荐使用,用 rslib 了,测试了一下,更简单很灵活,很棒!

另外请完善文档(以及中文文档支持),例如 Tailwind CSS 等只库上使用,打包不使用,自定义模板等等,现在这个文档  😂

功能请求:npm create rslib@latest 请添加一些命令行参数,可以选择不交互模式,如 --name / -n 名称,-lang / -l = ts ,additional : -a =biome 等等,方便拷贝一条命令就可以创建项目,而不是交互模式。

@Timeless0911
Copy link
Collaborator Author

Timeless0911 commented Nov 15, 2024

@lanmingle

突然说 Modern.js Module 不推荐使用,用 rslib 了,测试了一下,更简单很灵活,很棒!

Thank you for your dogfooding, we will release the first stable version 0.1.0 in the end of year.

另外请完善文档(以及中文文档支持),例如 Tailwind CSS 等只库上使用,打包不使用,自定义模板等等,现在这个文档 😂

Rslib documentation is still under construction, stay tuned for a stable version and we will translate the Chinese document after the English document is completed.

功能请求:npm create rslib@latest 请添加一些命令行参数,可以选择不交互模式,如 --name / -n 名称,-lang / -l = ts ,additional : -a =biome 等等,方便拷贝一条命令就可以创建项目,而不是交互模式。

You can open an issue in https://github.com/rspack-contrib/create-rstack.

@chenjiahan
Copy link
Member

You can open an issue in https://github.com/rspack-contrib/create-rstack.

create-rslib already provides some CLI flags, see: https://lib.rsbuild.dev/guide/start/quick-start#quick-creation

@lanmingle
Copy link

@lanmingle

突然说 Modern.js Module 不推荐使用,用 rslib 了,测试了一下,更简单很灵活,很棒!

Thank you for your dogfooding, we will release the first stable version 0.1.0 in the end of year.

另外请完善文档(以及中文文档支持),例如 Tailwind CSS 等只库上使用,打包不使用,自定义模板等等,现在这个文档 😂

Rslib documentation is still under construction, stay tuned for a stable version and we will translate the Chinese document after the English document is completed.

功能请求:npm create rslib@latest 请添加一些命令行参数,可以选择不交互模式,如 --name / -n 名称,-lang / -l = ts ,additional : -a =biome 等等,方便拷贝一条命令就可以创建项目,而不是交互模式。

You can open an issue in https://github.com/rspack-contrib/create-rstack.

rspack-contrib/create-rstack#21

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

No branches or pull requests

4 participants