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

rollup-plugin-inject

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-inject - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

4

CHANGELOG.md
# rollup-plugin-inject
## 3.0.1
* Generate sourcemap when sourcemap enabled
## 3.0.0

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

25

dist/rollup-plugin-inject.cjs.js

@@ -10,3 +10,3 @@ 'use strict';

const escape = (str) => {
const escape = str => {
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");

@@ -37,3 +37,3 @@ };

const flatten = (node) => {
const flatten = node => {
const parts = [];

@@ -70,5 +70,6 @@

modulesMap.forEach((mod, key) => {
modulesMap.set(key, Array.isArray(mod)
? [mod[0].split(path.sep).join("/"), mod[1]]
: mod.split(path.sep).join("/"));
modulesMap.set(
key,
Array.isArray(mod) ? [mod[0].split(path.sep).join("/"), mod[1]] : mod.split(path.sep).join("/")
);
});

@@ -83,3 +84,3 @@ }

);
const sourceMap = options.sourceMap !== false;
const sourceMap = options.sourceMap !== false && options.sourcemap !== false;

@@ -141,5 +142,3 @@ return {

} else {
newImports.set(hash, `import { ${mod[1]} as ${importLocalName} } from '${
mod[0]
}';`);
newImports.set(hash, `import { ${mod[1]} as ${importLocalName} } from '${mod[0]}';`);
}

@@ -189,7 +188,7 @@ }

code,
ast
ast,
map: sourceMap ? magicString.generateMap({ hires: true }) : null
};
}
const importBlock = Array.from(newImports.values())
.join("\n\n");
const importBlock = Array.from(newImports.values()).join("\n\n");

@@ -200,3 +199,3 @@ magicString.prepend(importBlock + "\n\n");

code: magicString.toString(),
map: sourceMap ? magicString.generateMap() : null
map: sourceMap ? magicString.generateMap({ hires: true }) : null
};

@@ -203,0 +202,0 @@ }

@@ -6,3 +6,3 @@ import { createFilter, attachScopes, makeLegalIdentifier } from 'rollup-pluginutils';

const escape = (str) => {
const escape = str => {
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");

@@ -33,3 +33,3 @@ };

const flatten = (node) => {
const flatten = node => {
const parts = [];

@@ -66,5 +66,6 @@

modulesMap.forEach((mod, key) => {
modulesMap.set(key, Array.isArray(mod)
? [mod[0].split(sep).join("/"), mod[1]]
: mod.split(sep).join("/"));
modulesMap.set(
key,
Array.isArray(mod) ? [mod[0].split(sep).join("/"), mod[1]] : mod.split(sep).join("/")
);
});

@@ -79,3 +80,3 @@ }

);
const sourceMap = options.sourceMap !== false;
const sourceMap = options.sourceMap !== false && options.sourcemap !== false;

@@ -137,5 +138,3 @@ return {

} else {
newImports.set(hash, `import { ${mod[1]} as ${importLocalName} } from '${
mod[0]
}';`);
newImports.set(hash, `import { ${mod[1]} as ${importLocalName} } from '${mod[0]}';`);
}

@@ -185,7 +184,7 @@ }

code,
ast
ast,
map: sourceMap ? magicString.generateMap({ hires: true }) : null
};
}
const importBlock = Array.from(newImports.values())
.join("\n\n");
const importBlock = Array.from(newImports.values()).join("\n\n");

@@ -196,3 +195,3 @@ magicString.prepend(importBlock + "\n\n");

code: magicString.toString(),
map: sourceMap ? magicString.generateMap() : null
map: sourceMap ? magicString.generateMap({ hires: true }) : null
};

@@ -199,0 +198,0 @@ }

{
"name": "rollup-plugin-inject",
"description": "Scan modules for global variables and inject `import` statements where necessary",
"version": "3.0.0",
"version": "3.0.1",
"devDependencies": {
"eslint": "^5.16.0",
"mocha": "^6.0.0",
"mocha": "^6.2.0",
"prettier": "^1.18.2",
"rollup": "^1.15.1",
"rollup": "^1.17.0",
"shx": "^0.3.2"

@@ -31,3 +31,3 @@ },

"estree-walker": "^0.6.1",
"magic-string": "^0.25.2",
"magic-string": "^0.25.3",
"rollup-pluginutils": "^2.8.1"

@@ -34,0 +34,0 @@ },

@@ -7,3 +7,3 @@ import { attachScopes, createFilter, makeLegalIdentifier } from "rollup-pluginutils";

const escape = (str) => {
const escape = str => {
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");

@@ -34,3 +34,3 @@ };

const flatten = (node) => {
const flatten = node => {
const parts = [];

@@ -67,5 +67,6 @@

modulesMap.forEach((mod, key) => {
modulesMap.set(key, Array.isArray(mod)
? [mod[0].split(sep).join("/"), mod[1]]
: mod.split(sep).join("/"));
modulesMap.set(
key,
Array.isArray(mod) ? [mod[0].split(sep).join("/"), mod[1]] : mod.split(sep).join("/")
);
});

@@ -80,3 +81,3 @@ }

);
const sourceMap = options.sourceMap !== false;
const sourceMap = options.sourceMap !== false && options.sourcemap !== false;

@@ -138,5 +139,3 @@ return {

} else {
newImports.set(hash, `import { ${mod[1]} as ${importLocalName} } from '${
mod[0]
}';`);
newImports.set(hash, `import { ${mod[1]} as ${importLocalName} } from '${mod[0]}';`);
}

@@ -186,7 +185,7 @@ }

code,
ast
ast,
map: sourceMap ? magicString.generateMap({ hires: true }) : null
};
}
const importBlock = Array.from(newImports.values())
.join("\n\n");
const importBlock = Array.from(newImports.values()).join("\n\n");

@@ -197,3 +196,3 @@ magicString.prepend(importBlock + "\n\n");

code: magicString.toString(),
map: sourceMap ? magicString.generateMap() : null
map: sourceMap ? magicString.generateMap({ hires: true }) : null
};

@@ -200,0 +199,0 @@ }

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