我试图用汇总保留尾随的独立评论。我简要地浏览了使用插件扩展 rollup 或深入研究 AST,但正在寻找可能的解决方案的指导。
输入
// Some comment
const foo = {};
// Another comment <-- I want this to remain
export { foo };
Run Code Online (Sandbox Code Playgroud)
输出
(function (exports) {
'use strict';
// Some comment
const foo = {};
exports.foo = foo;
return exports;
}({}));
Run Code Online (Sandbox Code Playgroud)
汇总配置
export default [
{
input: "src/index.js",
plugins: [],
output: {
file: "dist/index.js",
format: "iife",
name: "foo"
},
treeshake: false
}
];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
737 次 |
| 最近记录: |