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

Add license flag to create license file when running ncc #570

Merged
merged 3 commits into from
Aug 10, 2020
Merged

Add license flag to create license file when running ncc #570

merged 3 commits into from
Aug 10, 2020

Conversation

thboop
Copy link
Contributor

@thboop thboop commented Aug 5, 2020

This PR addresses #569

It adds the --license flag to use license-webpack-plugin to generate a license file alongside the ncc output to adhere to the terms of common software licenses.

Currently, there is an open issue where that plugin outputs some warnings, so the output for a run looks like

ncc: Version 0.22.3
ncc: Compiling file index.js
(node:75823) DeprecationWarning: Chunk.modulesIterable: Use new ChunkGraph API
(node:75823) DeprecationWarning: Chunk.entryModule: Use new ChunkGraph API
 63kB  dist/licenses.txt
811kB  dist/index.js

That is being tracked here and is hopefully resolved so we can minimize the output.

I did some local testing, but did not add any unit tests, let me know if there's some testing that would be worthwhile to add, and if you could provide some guidance on how to do so, I wasn't able to find a contributing.md or documentation.

@@ -206,68 +278,7 @@ module.exports = (
}
]
},
plugins: [
{
apply(compiler) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was just moved above so we can dynamically add the LicenseWebpackPlugin to this array based on the results of the license flag

src/cli.js Outdated Show resolved Hide resolved
@thboop thboop requested a review from styfle August 10, 2020 20:34
Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

Perfect, thanks! 🥇

@styfle styfle added the automerge Automatically merge PR once checks pass label Aug 10, 2020
src/index.js Outdated Show resolved Hide resolved
@kodiakhq kodiakhq bot merged commit efa79d4 into vercel:master Aug 10, 2020
@styfle
Copy link
Member

styfle commented Dec 24, 2020

Currently, there is an open issue where that plugin outputs some warnings

Looks like the deprecation warnings were fixed in 2.3.3

xz64/license-webpack-plugin#67 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NCC does not pack licenses that are required to be included with their software
2 participants