• Commonjs
  • Babel

    typescript

  • 安装相关依赖

    1. yarn add typescript tslib
    2. yarn add @rollup/plugin-typescript -D
  • 使用插件 ```javascript import ts from “@rollup/plugin-typescript”;

const plugins = [ ts(), ];

  1. - Replace
  2. - Node resolve
  3. <a name="B284V"></a>
  4. # eslint
  5. - 安装相关依赖
  6. ```javascript
  7. yarn add @rollup/plugin-eslint eslint -D
  8. yarn add eslint-config-standard eslint-plugin-import eslint-plugin-promise eslint-plugin-node -D
  • 修改配置

    import eslint from "@rollup/plugin-eslint";
    const plugins = [
    eslint({
      throwOnError: true,  // 如果语法不合格,打包直接报错
    }),
    ];
    

    image

  • 安装相关依赖

    yarn add @rollup/plugin-image -D
    
  • 修改配置

    import image from "@rollup/plugin-image";
    const plugins = [
    image(),
    ];
    
  • 添加代码

    import img from "./logo.png";
    console.log(img);
    

    strip

  • 安装相关依赖

    yarn add @rollup/plugin-strip -D
    
  • 修改配置

    import strip from "@rollup/plugin-strip";
    const plugins = [
    strip(),
    ];
    
  • wasm