rollup-plugin-es-info

Dump import/export information of each module

rollup-plugin-es-info

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

optionshas 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 importinformation. Default: true.
  • export?: boolean. If true then save exportinformation. Default: true.
  • dynamicImport?: boolean. If true then save dynamicImportinformation. Default: true.
  • strip?: boolean. If true then strip all the codes and leave only importstatements, 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.

Repository

eight04/rollup-plugin-es-info


上一篇:ordered-object
下一篇:sort-paths

相关推荐

官方社区

扫码加入 JavaScript 社区