rollupjs - 使用汇总保留独立评论
问题描述
我正在尝试使用汇总保留尾随的独立评论。我简要浏览了使用插件扩展汇总或深入研究 AST,但我正在寻找可能的解决方案的指导。
输入
// Some comment
const foo = {};
// Another comment <-- I want this to remain
export { foo };
输出
(function (exports) {
'use strict';
// Some comment
const foo = {};
exports.foo = foo;
return exports;
}({}));
汇总配置
export default [
{
input: "src/index.js",
plugins: [],
output: {
file: "dist/index.js",
format: "iife",
name: "foo"
},
treeshake: false
}
];
解决方案
推荐阅读
- python - 无法在两个背景图像之间切换
- javascript - 如何保持侧边栏布局固定,不能使用引导程序滚动?
- powershell - Azure DevOps Api 抛出错误:如何交换批准者?
- java - “找峰”算法的增长顺序是什么
- kotlin - Kotlin 中 Java 静态类的等价物是什么?
- python - 如何从用户输入中分离索引并在While循环中将它们添加(+)为INT?
- node.js - Stripe 连接 http 函数 firebase
- reactjs - ReactJS禁用在完整日历中的选定日期之外拖动
- java - 从字典中获取整数,不兼容的类型
- amazon-iam - 调用 ListUsers 操作时发生错误(InvalidClientTokenId):请求中包含的安全令牌无效