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

rollup-plugin-es3

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-es3 - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

17

dist/rollup-plugin-es3.cjs.js

@@ -5,7 +5,18 @@ 'use strict';

function es3 () {
function es3 (removeArr) {
var removeHash = {
'defineProperty': [/^\s*Object\.defineProperty\(\s*exports,\s*'__esModule'.*\n$/mg, ''],
'freeze': [/Object.freeze\s*\(\s*([^)]*)\)/g, '$1']
}
if (!Array.isArray(removeArr)) removeArr = Object.keys(removeHash)
return {
name: 'es3',
transformBundle: function (code, b) {
return code.replace(/^\s*Object\.defineProperty\(\s*exports,\s*'__esModule'.*\n$/m, '')
transformBundle: function (code) {
for (var k in removeHash) {
if (removeArr.indexOf(k) > -1) {
code = code.replace(removeHash[k][0], removeHash[k][1])
}
}
return code
}

@@ -12,0 +23,0 @@ }

// Make rollup compatible with ES3, remove Object.defineProperty of __esModule part
function es3 () {
function es3 (removeArr) {
var removeHash = {
'defineProperty': [/^\s*Object\.defineProperty\(\s*exports,\s*'__esModule'.*\n$/mg, ''],
'freeze': [/Object.freeze\s*\(\s*([^)]*)\)/g, '$1']
}
if (!Array.isArray(removeArr)) removeArr = Object.keys(removeHash)
return {
name: 'es3',
transformBundle: function (code, b) {
return code.replace(/^\s*Object\.defineProperty\(\s*exports,\s*'__esModule'.*\n$/m, '')
transformBundle: function (code) {
for (var k in removeHash) {
if (removeArr.indexOf(k) > -1) {
code = code.replace(removeHash[k][0], removeHash[k][1])
}
}
return code
}

@@ -9,0 +20,0 @@ }

2

package.json
{
"name": "rollup-plugin-es3",
"version": "1.0.1",
"version": "1.0.2",
"description": "Make rollup compatible with ES3, remove Object.defineProperty of __esModule part",

@@ -5,0 +5,0 @@ "main": "dist/rollup-plugin-es3.cjs.js",

@@ -7,5 +7,6 @@ # rollup-plugin-es3

Currently it's only do one thing:
Currently it's only do 2 things:
- Remove Object.defineProperty of __esModule part
- Remove Object.defineProperty of __esModule part (rollup issue [#750](https://github.com/rollup/rollup/issues/750))
- Remove Object.freeze (issue #1)

@@ -32,1 +33,10 @@ ## Install

## Option
``` javascript
// pass the list of removal
plugins: [
es3(['defineProperty', 'freeze'])
]
```
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