rollup-plugin-commonjs
Advanced tools
Comparing version 4.0.0 to 4.0.1
# rollup-plugin-commonjs changelog | ||
## 4.0.1 | ||
* Fix `ignoreGlobal` option ([#86](https://github.com/rollup/rollup-plugin-commonjs/pull/86)) | ||
## 4.0.0 | ||
@@ -4,0 +8,0 @@ |
@@ -196,3 +196,3 @@ 'use strict'; | ||
uses[ node.name ] = true; | ||
if ( node.name === 'global' ) magicString.overwrite( node.start, node.end, (HELPERS_NAME + ".commonjsGlobal") ); | ||
if ( node.name === 'global' && !ignoreGlobal ) magicString.overwrite( node.start, node.end, (HELPERS_NAME + ".commonjsGlobal") ); | ||
} | ||
@@ -204,3 +204,3 @@ return; | ||
uses.global = true; | ||
magicString.overwrite( node.start, node.end, (HELPERS_NAME + ".commonjsGlobal"), true ); | ||
if ( !ignoreGlobal ) magicString.overwrite( node.start, node.end, (HELPERS_NAME + ".commonjsGlobal"), true ); | ||
return; | ||
@@ -243,3 +243,3 @@ } | ||
if ( !sources.length && !uses.module && !uses.exports && !uses.global ) { | ||
if ( !sources.length && !uses.module && !uses.exports && ( ignoreGlobal || !uses.global ) ) { | ||
if ( Object.keys( namedExports ).length ) { | ||
@@ -246,0 +246,0 @@ throw new Error( ("Custom named exports were specified for " + id + " but it does not appear to be a CommonJS module") ); |
@@ -193,3 +193,3 @@ import { statSync } from 'fs'; | ||
uses[ node.name ] = true; | ||
if ( node.name === 'global' ) magicString.overwrite( node.start, node.end, (HELPERS_NAME + ".commonjsGlobal") ); | ||
if ( node.name === 'global' && !ignoreGlobal ) magicString.overwrite( node.start, node.end, (HELPERS_NAME + ".commonjsGlobal") ); | ||
} | ||
@@ -201,3 +201,3 @@ return; | ||
uses.global = true; | ||
magicString.overwrite( node.start, node.end, (HELPERS_NAME + ".commonjsGlobal"), true ); | ||
if ( !ignoreGlobal ) magicString.overwrite( node.start, node.end, (HELPERS_NAME + ".commonjsGlobal"), true ); | ||
return; | ||
@@ -240,3 +240,3 @@ } | ||
if ( !sources.length && !uses.module && !uses.exports && !uses.global ) { | ||
if ( !sources.length && !uses.module && !uses.exports && ( ignoreGlobal || !uses.global ) ) { | ||
if ( Object.keys( namedExports ).length ) { | ||
@@ -243,0 +243,0 @@ throw new Error( ("Custom named exports were specified for " + id + " but it does not appear to be a CommonJS module") ); |
{ | ||
"name": "rollup-plugin-commonjs", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Convert CommonJS modules to ES2015", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -110,3 +110,3 @@ import acorn from 'acorn'; | ||
uses[ node.name ] = true; | ||
if ( node.name === 'global' ) magicString.overwrite( node.start, node.end, `${HELPERS_NAME}.commonjsGlobal` ); | ||
if ( node.name === 'global' && !ignoreGlobal ) magicString.overwrite( node.start, node.end, `${HELPERS_NAME}.commonjsGlobal` ); | ||
} | ||
@@ -118,3 +118,3 @@ return; | ||
uses.global = true; | ||
magicString.overwrite( node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, true ); | ||
if ( !ignoreGlobal ) magicString.overwrite( node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, true ); | ||
return; | ||
@@ -157,3 +157,3 @@ } | ||
if ( !sources.length && !uses.module && !uses.exports && !uses.global ) { | ||
if ( !sources.length && !uses.module && !uses.exports && ( ignoreGlobal || !uses.global ) ) { | ||
if ( Object.keys( namedExports ).length ) { | ||
@@ -160,0 +160,0 @@ throw new Error( `Custom named exports were specified for ${id} but it does not appear to be a CommonJS module` ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
112206
0