Preserving comments in create-react-app (react-scripts v4)

Viewed 141

Is there any way to keep some comments in the source code for create-react-app (react-scripts v4.0.3 at the time of writing this)? I'm trying to get a comment like this to be preserved in a production build:

/**
 * @license Copyright (c) blah blah blah
 * Written by Blah blah
 */

I see this GitHub issue about this very problem: https://github.com/facebook/create-react-app/issues/4596

And supposedly it was fixed by this PR: https://github.com/facebook/create-react-app/pull/4601#issuecomment-424589230

But according to this comment Terser is used instead of Uglify https://github.com/facebook/create-react-app/pull/4601#issuecomment-424589230

I see that several license comments are preserved in the production build that are in node_modules, and I suppose I could have a module just for the sake of including license info, but I'd really like to preserve comments in the source code if possible.

0 Answers
Related