Skip to content

Conversation

@bluwy
Copy link
Member

@bluwy bluwy commented Nov 1, 2024

Description

closes #17892
supersedes and closes #18104

Very crude implementation for license support. It supports outputting to .vite/license.md by default, however you can set a path with .json to output in .json format for further processing.

It doesn't contain all dependency package.json information or all features of https://github.com/mjeanroy/rollup-plugin-license. I don't think we should implement all of it, but we could expose more information to be sufficiently flexible for extending or customizing the output. It also does not contain licenses for the project itself.

Open to discussion of how the API and output should look like. You can check out the snapshot tests for example of the current output.

@bluwy bluwy added p2-nice-to-have Not breaking anything but nice to have (priority) feat: build labels Nov 4, 2024
@bluwy bluwy marked this pull request as ready for review November 4, 2024 06:44
@sapphi-red
Copy link
Member

I wonder if we should add a comment that includes link to the license file. TerserWebpackPlugin adds them.

The API and the implementation looks good to me. I even think that the current information is sufficient. I think this feature should focus on license compliance and I believe all the necessary information is included in the license file.

(Sorry that it took almost an year 🙏)

@bluwy
Copy link
Member Author

bluwy commented Oct 20, 2025

Better late than never 😄

I wonder if we should add a comment that includes link to the license file. TerserWebpackPlugin adds them.

Do you mean for the inline legal comments, we rewrite it as a link to the output file we generate? It's a bit tricky to do that I think as the output file may not be the final file if it was postprocessed. Or perhaps it's hosted in a different place.

Maybe it's something we can support later though as it requires a new option, and on the topic of more options, maybe it's more scalable if the types are boolean | { fileName: string } now instead of boolean | string.

@sapphi-red
Copy link
Member

I wonder if we should add a comment that includes link to the license file. TerserWebpackPlugin adds them.

Do you mean for the inline legal comments, we rewrite it as a link to the output file we generate? It's a bit tricky to do that I think as the output file may not be the final file if it was postprocessed. Or perhaps it's hosted in a different place.

I guess yes, I was thinking of adding a comment like // License information can be found in ../license.md. Hmm, maybe it's fine by just adding a document how to achieve it (e.g. add an example using banner).

@github-project-automation github-project-automation bot moved this to Discussing in Team Board Oct 21, 2025
@sapphi-red sapphi-red removed this from Team Board Oct 21, 2025
@sapphi-red sapphi-red added this to the 7.2 milestone Oct 21, 2025
@sapphi-red sapphi-red merged commit b42c3fb into main Oct 22, 2025
19 checks passed
@sapphi-red sapphi-red deleted the emit-license branch October 22, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: build p2-nice-to-have Not breaking anything but nice to have (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract license info outside of the JavaScript bundle

6 participants