配置文件

{
    output: {
        file:'bundle.js', // 输出文件
        format: 'cjs,  //  五种输出格式:amd /  es6 / iife / umd / cjs
        name:'A',  //当format为iife和umd时必须提供,将作为全局变量挂在window(浏览器环境)下:window.A=...
        sourcemap:true  //生成bundle.map.js文件,方便调试
    }
}

 

插件

rollup-plugin-delete:rollup支持删除文件

rollup-plugin-copy:rollup支持复制文件

@rollup/plugin-node-resolve:支持rollup处理外部模块,如node_modules中模块

@rollup/plugin-commonjs:将commonjs模块转为es6模块

@rollup/plugin-babel:rullup支持babel

相关文章:

  • 2021-08-17
  • 2021-12-02
  • 2021-11-22
  • 2021-09-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2022-02-21
相关资源
相似解决方案