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

rollup-plugin-commonjs

Package Overview
Dependencies
Maintainers
3
Versions
70
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 8.1.1 to 8.2.0

LICENSE

4

CHANGELOG.md
# rollup-plugin-commonjs changelog
## 8.2.0
* Avoid using `index` as a variable name ([#208](https://github.com/rollup/rollup-plugin-commonjs/pull/208))
## 8.1.1

@@ -4,0 +8,0 @@

@@ -163,3 +163,9 @@ 'use strict';

function getName ( id ) {
return rollupPluginutils.makeLegalIdentifier( path.basename( id, path.extname( id ) ) );
var name = rollupPluginutils.makeLegalIdentifier( path.basename( id, path.extname( id ) ) );
if (name !== 'index') {
return name;
} else {
var segments = path.dirname( id ).split( path.sep );
return rollupPluginutils.makeLegalIdentifier( segments[segments.length - 1] );
}
}

@@ -166,0 +172,0 @@

@@ -159,3 +159,9 @@ import { statSync } from 'fs';

function getName ( id ) {
return makeLegalIdentifier( basename( id, extname( id ) ) );
var name = makeLegalIdentifier( basename( id, extname( id ) ) );
if (name !== 'index') {
return name;
} else {
var segments = dirname( id ).split( sep );
return makeLegalIdentifier( segments[segments.length - 1] );
}
}

@@ -162,0 +168,0 @@

5

package.json
{
"name": "rollup-plugin-commonjs",
"version": "8.1.1",
"version": "8.2.0",
"description": "Convert CommonJS modules to ES2015",

@@ -11,3 +11,3 @@ "main": "dist/rollup-plugin-commonjs.cjs.js",

"pretest": "npm run build",
"build": "rm -rf dist/* && rollup -c",
"build": "shx rm -rf dist/* && rollup -c",
"dev": "rollup -c -w",

@@ -37,2 +37,3 @@ "lint": "eslint src/*.js test/*.js",

"rollup-plugin-node-resolve": "^3.0.0",
"shx": "^0.2.2",
"source-map": "^0.5.7",

@@ -39,0 +40,0 @@ "source-map-support": "^0.4.16"

@@ -1,7 +0,13 @@

import { basename, extname } from 'path';
import { basename, extname, dirname, sep } from 'path';
import { makeLegalIdentifier } from 'rollup-pluginutils';
export function getName ( id ) {
return makeLegalIdentifier( basename( id, extname( id ) ) );
const name = makeLegalIdentifier( basename( id, extname( id ) ) );
if (name !== 'index') {
return name;
} else {
const segments = dirname( id ).split( sep );
return makeLegalIdentifier( segments[segments.length - 1] );
}
}

Sorry, the diff of this file is not supported yet

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