Skip to content

@license comments not preserved by default #450

@jacobcarpenter

Description

@jacobcarpenter

Describe the bug

Looking at bundled output from npm:rolldown-vite@^7.1.17, I'm noticing a dearth of copyright/license declarations.

When I compare the same source built with [email protected] (using the same minimal config), I can see the license block comments preserved in the dist output.

Is this a new default behavior for rolldown-vite? Is there a way I can turn on license preservation? (I went looking in the vite.config oxc options, but didn't see any obvious switches to flick.)

Reproduction

https://stackblitz.com/edit/stackblitz-starters-uz1ahmtm?file=dist%2Fassets%2Findex-BGp9oQm3.js

Steps to reproduce

With a basic React + Vite app from create vite template (using rolldown-vite):

  1. run npm run build
  2. examine dist/assets/index-*.js

Notice that it doesn't have any copyright declarations.

If you switch to Vite (no rolldown), and repeat the test, the bundled js will preserve copyright declarations.

System Info

System:
    OS: macOS 15.6.1
    CPU: (14) arm64 Apple M4 Max
    Memory: 142.27 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.15.0 - <redacted>/.nvm/versions/node/v22.15.0/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 11.6.2 - <redacted>/.nvm/versions/node/v22.15.0/bin/npm
    bun: 1.2.16 - <redacted>/.bun/bin/bun
  Browsers:
    Brave Browser: 141.1.83.112
    Chrome: 141.0.7390.77
    Safari: 18.6
  npmPackages:
    @vitejs/plugin-react: ^5.0.4 => 5.0.4 
    rolldown-vite:  7.1.16

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: upstreamBug in a dependency of Vite

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions