Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rollup/plugin-commonjs

Package Overview
Dependencies
Maintainers
4
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rollup/plugin-commonjs - npm Package Compare versions

Comparing version 22.0.0-14 to 22.0.0

46

CHANGELOG.md
# @rollup/plugin-commonjs ChangeLog
## v22.0.0
_2022-04-24_
### Breaking Changes
- fix: add heuristic to deoptimize requires after calling imported function (requires rollup@2.68.0) (#1038)
- feat: reimplement dynamic import handling (requires Node 12, no longer supports require.cache) (#1038)
### Bugfixes
- fix: support CJS modules re-exporting transpiled ESM modules (#1165)
- fix: Warn when plugins do not pass options to resolveId (#1038)
- fix: Do not change semantics when removing requires in if statements (#1038)
- fix: handle external dependencies when using the cache (#1038)
- fix: proxy all entries to not break legacy polyfill plugins (#1038)
- fix: use correct version and add package exports (#1038)
- fix: validate node-resolve peer version (#1038)
- fix: inject module name into dynamic require function (#1038)
- fix: do not transform "typeof exports" for mixed modules (#1038)
- fix: attach correct plugin meta-data to commonjs modules (#1038)
### Features
- feat: expose plugin version (#1038)
- feat: throw for dynamic requires from outside the configured root (#1038)
- feat: add dynamicRequireRoot option (#1038)
- feat: auto-detect conditional requires (#1038)
- feat: limit ignoreTryCatch to external requires (#1038)
- feat: make namespace callable when requiring ESM with function default (#1038)
- feat: Infer type for unidentified modules (#1038)
- feat: automatically wrap cyclic modules (#1038)
- feat: add strictRequires option to wrap modules (#1038)
### Updates
- refactor: deconflict helpers only once globals are known (#1038)
## v21.1.0
_2022-04-15_
### Features
- feat: make defaultIsModuleExports as funtion to config defaultIsModuleExports for each source (#1052)
## v21.0.3

@@ -4,0 +50,0 @@

2

package.json
{
"name": "@rollup/plugin-commonjs",
"version": "22.0.0-14",
"version": "22.0.0",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

@@ -71,2 +71,4 @@ [npm]: https://img.shields.io/npm/v/@rollup/plugin-commonjs

_Note: In previous versions, this option would spin up a rather comprehensive mock environment that was capable of handling modules that manipulate `require.cache`. This is no longer supported. If you rely on this e.g. when using request-promise-native, use version 21 of this plugin._
Some modules contain dynamic `require` calls, or require modules that contain circular dependencies, which are not handled well by static imports.

@@ -73,0 +75,0 @@ Including those modules as `dynamicRequireTargets` will simulate a CommonJS (NodeJS-like) environment for them with support for dynamic dependencies. It also enables `strictRequires` for those modules, see above.

@@ -5,2 +5,3 @@ import { FilterPattern } from '@rollup/pluginutils';

type RequireReturnsDefaultOption = boolean | 'auto' | 'preferred' | 'namespace';
type DefaultIsModuleExportsOption = boolean | 'auto';

@@ -200,3 +201,10 @@ interface RollupCommonJSOptions {

| ((id: string) => RequireReturnsDefaultOption);
/**
* @default "auto"
*/
defaultIsModuleExports?:
| DefaultIsModuleExportsOption
| ((id: string) => DefaultIsModuleExportsOption);
/**
* Some modules contain dynamic `require` calls, or require modules that

@@ -203,0 +211,0 @@ * contain circular dependencies, which are not handled well by static

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc