1 问题
(!) Entry module “src/main.js” is implicitly using “default” export mode, which means for CommonJS output that its default export is assigned to “module.exports”. For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set “output.exports” to either “auto” or “default”, otherwise you might want to consider changing the signature of “src/main.js” to use named exports only.
2 解决
import babel from "@rollup/plugin-babel";
export default {
input: "src/main.js",
output: [
{
file: "lib/index.cjs.js",
format: "cjs",
exports: "auto",
},
{
file: "lib/index.ems.js",
format: "esm",
exports: "auto",
},
],
plugins: [babel({ babelHelpers: "bundled" })],
};
复制代码
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END