Skip to content

Conversation

@ZiuChen
Copy link
Contributor

@ZiuChen ZiuChen commented Oct 31, 2025

Addresses vitejs/rolldown-vite#459 where users discovered their configured banner and footer content was stripped during minification.

Changes

Added In-depth sections to banner and footer documentation explaining legal comment preservation:

  • Comment formats that survive minification:

    • /*! prefix: /*! My banner */
    • @license keyword: /* @license My banner */
    • @preserve keyword: /* @preserve My banner */
    • //! prefix for single-line comments
  • Minification example showing proper usage with minify: true

  • Cross-reference to output.legalComments option (defaults to 'inline')

Example

export default {
  output: {
    banner: '/*! My Library v1.0.0 | MIT License */',
    minify: true,  // Banner persists due to /*! syntax
  },
};

Screenshot

image

The table of contents now shows the new "In-depth" and "Example with minification" subsections under both banner and footer options.

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 31, 2025

How to use the Graphite Merge Queue

Add the label graphite: merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@ZiuChen ZiuChen changed the title Add minification preservation instructions for banner/footer options docs: Add minification preservation instructions for banner/footer options Oct 31, 2025
@shulaoda shulaoda requested a review from Copilot October 31, 2025 06:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds warning documentation about banner and footer content being stripped during minification. The changes inform users that banners and footers need to be formatted as legal comments to persist through minification.

  • Added identical warning blocks to both the banner and footer sections
  • Documented the legal comment formats that preserve content during minification
  • Referenced the legalComments option for additional context

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hyf0

This comment was marked as outdated.

@hyf0
Copy link
Member

hyf0 commented Oct 31, 2025

I think current rolldown's behavior is wrong. We might want to solve it in rolldown's side.

Just saw vitejs/rolldown-vite#459 (comment). Adding document is a good move.

@hyf0
Copy link
Member

hyf0 commented Oct 31, 2025

I still want to check esbuild's behavior in relation to this.

Copy link
Member

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

ZiuChen and others added 3 commits November 3, 2025 16:41
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Yunfei He <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Signed-off-by: Yunfei He <[email protected]>
@hyf0 hyf0 force-pushed the docs/banner-in-depth branch from 48a5253 to 77f6513 Compare November 3, 2025 08:41
@hyf0 hyf0 enabled auto-merge (squash) November 3, 2025 08:41
@hyf0 hyf0 disabled auto-merge November 3, 2025 08:41
@hyf0 hyf0 enabled auto-merge (squash) November 3, 2025 08:41
@hyf0 hyf0 changed the title docs: Add minification preservation instructions for banner/footer options docs: add minification preservation instructions for banner/footer options Nov 3, 2025
@netlify
Copy link

netlify bot commented Nov 3, 2025

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit f0ac2dc
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69086a79df35a40009dd7901
😎 Deploy Preview https://deploy-preview-6786--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 3, 2025

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 77f6513
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69086aa16d889900088b92e1
😎 Deploy Preview https://deploy-preview-6786--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hyf0 hyf0 merged commit dc862e1 into rolldown:main Nov 3, 2025
25 checks passed
@github-actions github-actions bot mentioned this pull request Nov 5, 2025
shulaoda added a commit that referenced this pull request Nov 5, 2025
## [1.0.0-beta.47] - 2025-11-05

### 💥 BREAKING CHANGES

- `meta.magicString` and `meta.ast` now only initialized once (#6828) by @IWANABETHATGUY

### 🚀 Features

- rolldown_plugin_utils: support common module preload config (#6839) by @shulaoda
- expose `minify` function (#6836) by @sapphi-red
- rolldown_plugin_build_import_analysis: remove all `__VITE_PRELOAD__` (#6833) by @shulaoda
- rolldown_plugin_build_import_analysis: inject __vite__mapDeps (#6832) by @shulaoda
- rolldown_plugin_build_import_analysis: align partial logic (#6831) by @shulaoda
- expose more magic string method in js binding (#6819) by @IWANABETHATGUY
- rolldown_plugin_build_import_analysis: align renderBuiltUrl logic (#6808) by @shulaoda
- rolldown_plugin_build_import_analysis: align resolve dependencies logic (#6803) by @shulaoda
- rolldown_plugin_build_import_analysis: align partial logic (#6802) by @shulaoda

### 🐛 Bug Fixes

- rolldown_plugin_build_import_analysis: correct unaligned code (#6845) by @shulaoda
- rolldown_binding: resolveDependencies shouldn't return Promise (#6844) by @shulaoda
- browser: correct binding file (#6830) by @sxzz

### 🚜 Refactor

- rolldown_plugin_vite_html: use module preload instead (#6843) by @shulaoda
- rolldown_plugin_build_import_analysis: use module preload config instead (#6841) by @shulaoda
- rolldown_binding: correct `renderBuiltUrl` (#6835) by @shulaoda
- rolldown_plugin_build_import_analysis: remove unnecessary is_module_preload (#6834) by @shulaoda
- rolldown_plugin_build_import_analysis: remove unnecessary `IS_MODERN_FLAG` (#6823) by @shulaoda
- rolldown_plugin_build_import_analysis: tweak v2 config (#6804) by @shulaoda

### 📚 Documentation

- add link to Native MagicString In-Depth Guide and fix broken markdown syntax (#6827) by @IWANABETHATGUY
- update current status of native magic string (#6820) by @IWANABETHATGUY
- add specific use cases (#6822) by @shulaoda
- add minification preservation instructions for banner/footer options (#6786) by @ZiuChen

### ⚙️ Miscellaneous Tasks

- deps: bump oxc-resolver to v11.13.1 (#6847) by @renovate[bot]
- deps: update dependency tsdown to v0.16.0 (#6840) by @renovate[bot]
- README.md: fix broken documentation link to getting started guide (#6837) by @Cheng-fung

### ❤️ New Contributors

* @Cheng-fung made their first contribution in [#6837](#6837)
* @ZiuChen made their first contribution in [#6786](#6786)

Co-authored-by: shulaoda <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants