reactjs - 在 create-react-app (react-scripts v4) 中保留注释
问题描述
有什么方法可以在 create-react-app 的源代码中保留一些注释(在撰写本文时,react-scripts v4.0.3)?我正在尝试将这样的评论保留在生产版本中:
/**
* @license Copyright (c) blah blah blah
* Written by Blah blah
*/
我看到这个关于这个问题的 GitHub 问题:https ://github.com/facebook/create-react-app/issues/4596
据说它是由这个 PR 修复的:https ://github.com/facebook/create-react-app/pull/4601#issuecomment-424589230
但根据此评论,使用 Terser 而不是 Uglify https://github.com/facebook/create-react-app/pull/4601#issuecomment-424589230
我看到在生产版本中保留了几个许可证注释node_modules
,我想我可以有一个模块只是为了包含许可证信息,但如果可能的话,我真的很想在源代码中保留注释。
解决方案
推荐阅读
- java - 从自定义对话框中的复选框保存状态
- python - 值错误:微秒必须在 0..999999
- c++ - 保持线程在模态对话框中运行 c++ mfc
- c++ - 带有成员函数指针的VS c ++编译模板有错误
- email - 禁用异地邮件中继
- javascript - 将两个 html 页面与名为 index.html 的第一页链接,但需要附加参数才能在问号标记中执行
- asp.net - 无法使用 MSALjs 使用访问令牌获取图形 api 用户组
- aws-batch - 为 AWS Batch 挂载卷
- java - org.springframework.dao.IncorrectResultSizeDataAccessException:查询没有返回唯一结果:22
- xcode - 缺少 Apple CarPlay 权利