Legal comments are no longer kept in bundle
See original GitHub issueBug report
Describe the bug
Previous versions of Next.js (at lest v7.x) included legal comments in the commons.js bundle:
(window.webpackJsonp=window.webpackJsonp||[]).push([[0], /* ... */
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
...
In v9.0.x and v9.2.x, those legal comments are now stripped out:
(window.webpackJsonp=window.webpackJsonp||[]).push([[0] /* ... */
To Reproduce
next build && next export- Serve files locally (e.g.
npx http-serve out -p 3000) - Browse generated assets in the devtools (
commons-xxxx.jsin particular).
Expected behavior
Legal comments should be kept in the bundle, and I believe that’s the default webpack configuration.
Screenshots
See snippets above.
System information
- OS: macOS
- Browser (if applies) Chrome v79
- Version of Next.js: v9.2 (vs v7.x)
Thanks for looking into this!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Unable to strip comments in webpack bundle js file
UglifyJsPlugin don't remove @licence comments even if you set comments: false for legal reasons. You can read about it on webpack GitHub issue....
Read more >ANOTHER COMMENT ON BUNDLES: TOO MUCH AND TOO ...
More on Bundles: there is much time and money to be saved yet. Lengthy bundles and interim costs. Get bundles and skeletons to...
Read more >Why Do Firms Bundle And Tie? Evidence From Competitive ...
The law presumes that tying allows a firm to leverage market power from one good to another. But tying is a common practice...
Read more >THE BLUEBOOK MADE EASY - Penn State Law
Bluebook citation is used by most law reviews and journals, ... Abbreviate other words of 8 letters or more if substantial space is...
Read more >Attorney Advertising, Solicitation, and Professional Notices
A lawyer may write for publication on legal topics (or speak publicly) without affecting the right to accept employment so long as the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Is there a best practice about where to put this license file or how to make it discoverable to anyone concerned?
We mirror create-react-app’s behavior here.
The comments are of no actual use in production bundles as the original code is not preserved (minified) and the comment as is covers the full file because everything is minified, which is incorrect. Instead you should compile a list of license files from all npm deps that you have, not just the ones with comments. You can use something like: https://www.npmjs.com/package/npm-license-crawler.