rollup-plugin-es-info

2019-11-22

rollup-plugin-es-info是什么

什么是rollup-plugin-es-info,Dump import/export information of each module

rollup-plugin-es-info使用教程帮助文档

rollup-plugin-es-info

Build Status Coverage Status

Dump import/export information of each module. The information is extracted by es-info.

Installation

npm install -D rollup-plugin-es-info

Usage

import esInfo from "rollup-plugin-es-info"

export default {
  input: ["entry.js"],
  output: {
    dir: "dist",
    format: "cjs"
  },
  plugins: [
    esInfo({
      include: ["**/*"],
      file: "es-info.json",
      import: false,
      dynamicImport: false,
      strip: true
    })
  ]
};

API reference

This module exports a single function.

esInfoPluginFactory(options): RollupPlugin object

options has following properties:

  • include?: Array<string>. A list of minimatch pattern. Only matched files are processed. If undefined then match all files.
  • exclude?: Array<string>. A list of minimatch pattern. Matched files are excluded.
  • file?: string. A filename. If set then output the information table to the file.
  • ongenerate?: function. When the bundle is generated, this function is called with an object map. Each key is the module path relative to cwd and the value is the information about the module.
  • import?: boolean. If true then save import information. Default: true.
  • export?: boolean. If true then save export information. Default: true.
  • dynamicImport?: boolean. If true then save dynamicImport information. Default: true.
  • strip?: boolean. If true then strip all the codes and leave only import statements, resulting a faster build. Turn this on if you don't need the actual bundle e.g. you are just linting the code/verifying the dependency tree. Default: false.

Changelog

  • 0.2.0 (Jun 5, 2019)

    • Bump dependencies. Update rollup to 1.13.1.
  • 0.1.3 (May 3, 2018)

    • Change: keep the key order of imports.
  • 0.1.2 (May 3, 2018)

    • Change: keep the key order of output JSON. use sort-paths.
  • 0.1.1 (May 3, 2018)

    • Fix: gencode problem for dynamic imports.
  • 0.1.0 (May 2, 2018)

    • Initial releast.

上一篇:ordered-object
下一篇:sort-paths
相关文章

首次访问,人机识别验证

扫描下方二维码回复 1024 获取验证码,验证完毕后 永久 无须验证

操作步骤:[打开微信]->[扫描上侧二维码]->[关注 FedJavaScript 的微信] 输入 1024 获取验证码

验证码有误,请重新输入