rollup

  • 1、@rollup/plugin-commonjs :Since most packages in your node_modules folder are probably legacy CommonJS rather than JavaScript modules, you may need to use @rollup/plugin-commonjs:

  • 2、@rollup/plugin-node-resolve:using third party modules in node_modules

  • 3、@rollup/plugin-babel
    并且使用@rollup/plugin-commonjs
    babel({
    exclude: 'node_modules/**' // 解决打包后存在require 问题
    }),
    commonjs()

上一篇:javaScript对象学习笔记(一)


下一篇:Rollup_Parcel_snowpack_Vite