rollup / rollup-plugin-commonjs

This module has moved and is now available at @rollup/plugin-commonjs / https://github.com/rollup/plugins/blob/master/packages/commonjs
MIT License
502 stars 126 forks source link

Documentation: Simple One File Conversion #280

Closed backspaces closed 6 years ago

backspaces commented 6 years ago

The documentation shows a very general rollup including both cjs and other files, all be converted to an iife bundle. I think! :)

Could you show a single file conversion of a cjs file to a module? This would let me convert vender cjs files one-at-a-time.

It would even be better if each could be done on the command line .. i.e. a general config that has the input and output files specified on the command line along with the plugin config file.

adrianheine commented 6 years ago

This package is not intended for converting cjs files into modules on its own, it's just a plugin for rollup, and rollup creates cjs code in the end. So maybe you can leverage this package for your use-case, but I actually doubt it.

backspaces commented 6 years ago

Thanks, very clear. I'll close this.