Back to results
ntkoopman/rollup-plugin-cjs(opens in a new tab)
Language: JavaScript
Import commonjs modules
- stars
- 1
- watchers
- 1
- forks
- 0
- open issues
- 0
- Last updated
- 04/03/2021
Language: JavaScript
Import commonjs modules
Converts CommonJS files to ES modules in a way that's compatible with __esModule files.
Unlike @rollup/plugin-commonjs, this plugin will check for the existence of __esModule at
runtime, which should improve compatibility with packages in the wild.
This plugin should replace @rollup/plugin-commonjs:
import cjs from "rollup-plugin-cjs"; export default { input: "src/index.js", output: { dir: "output", }, plugins: [cjs()], };
require (e.g. (function(r){r('lib')})(require)) will not work.import * as lib from 'commonjs-lib the imported values are not live.require is not supported.All of these could be fixed, they are just not implemented at the moment.