https://github.com/eight04/rollup-plugin-es-info
Dump import/export information of each module.
https://github.com/eight04/rollup-plugin-es-info
es-module rollup rollup-plugin
Last synced: 8 months ago
JSON representation
Dump import/export information of each module.
- Host: GitHub
- URL: https://github.com/eight04/rollup-plugin-es-info
- Owner: eight04
- License: mit
- Created: 2018-05-01T18:16:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-07T19:50:52.000Z (over 3 years ago)
- Last Synced: 2025-04-21T07:09:53.222Z (9 months ago)
- Topics: es-module, rollup, rollup-plugin
- Language: JavaScript
- Size: 115 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
rollup-plugin-es-info
=====================
[](https://travis-ci.org/eight04/rollup-plugin-es-info)
[](https://coveralls.io/github/eight04/rollup-plugin-es-info?branch=master)
Dump import/export information of each module. The information is extracted by [es-info](https://github.com/eight04/es-info).
Installation
------------
```
npm install -D rollup-plugin-es-info
```
Usage
-----
```js
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`. A list of minimatch pattern. Only matched files are processed. If undefined then match all files.
* `exclude?`: `Array`. 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.3.0 (Aug 8, 2022)
- Bump dependencies. Update rollup to 2.77.2.
* 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.