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

feat: support banner and footer #175

Merged
merged 5 commits into from
Sep 5, 2024
Merged

feat: support banner and footer #175

merged 5 commits into from
Sep 5, 2024

Conversation

Timeless0911
Copy link
Collaborator

@Timeless0911 Timeless0911 commented Sep 5, 2024

Summary

This PR implements the banner and footer feature.

We use bannerPlugin of Rspack to add banner and footer in js/css build.

Notice:

  1. only string type is supported and will not be wrapped in a comment.
  2. The default stage is PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE + 1 to prevent avoid influence of minimizers
  3. If you have further demand on banner and footer, you can directly use bannerPlugin.
type BannerAndFooter = {
  js?: string;
  css?: string;
  dts?: string;
};

interface LibConfig extends RsbuildConfig {
  banner?: BannerAndFooter;
  footer?: BannerAndFooter;
}

Since support of css of bundleless mode is not ready, we ignore css banner and footer tests in bundleless mode.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

packages/core/src/config.ts Outdated Show resolved Hide resolved
e2e/cases/banner-footer/rslib.config.ts Show resolved Hide resolved
@fi3ework fi3ework enabled auto-merge (squash) September 5, 2024 08:39
@fi3ework fi3ework merged commit ee425c1 into main Sep 5, 2024
6 checks passed
@fi3ework fi3ework deleted the feat/banner-and-footer branch September 5, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants