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

rollup-plugin-external-globals

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-external-globals - npm Package Compare versions

Comparing version 0.6.1 to 0.7.1

4

index.js

@@ -33,3 +33,3 @@ const MagicString = require("magic-string");

function transform(code, id) {
async function transform(code, id) {
if ((id[0] !== "\0" && !filter(id)) || (isGlobalsObj && Object.keys(globals).every(id => !code.includes(id)))) {

@@ -40,3 +40,3 @@ return;

code = new MagicString(code);
const isTouched = importToGlobals({
const isTouched = await importToGlobals({
ast,

@@ -43,0 +43,0 @@ code,

@@ -1,5 +0,12 @@

const {walk} = require("estree-walker");
const isReference = require("is-reference");
const {attachScopes, makeLegalIdentifier} = require("@rollup/pluginutils");
let walk, isReference;
async function prepare() {
[{walk}, {default: isReference}] = await Promise.all([
import("estree-walker"),
import("is-reference")
]);
}
function analyzeImport(node, importBindings, code, getName, globals) {

@@ -97,3 +104,4 @@ const name = node.source.value && getName(node.source.value);

function importToGlobals({ast, code, getName, getDynamicWrapper}) {
async function importToGlobals({ast, code, getName, getDynamicWrapper}) {
await prepare();
let scope = attachScopes(ast, "scope");

@@ -100,0 +108,0 @@ const bindings = new Map;

{
"name": "rollup-plugin-external-globals",
"version": "0.6.1",
"version": "0.7.1",
"description": "Transform external imports into global variables like output.globals.",

@@ -28,18 +28,18 @@ "keywords": [

"devDependencies": {
"c8": "^7.3.4",
"endent": "^2.0.1",
"eslint": "^7.11.0",
"mocha": "^8.2.0",
"rollup": "^2.32.0",
"c8": "^7.12.0",
"endent": "^2.1.0",
"eslint": "^8.28.0",
"mocha": "^10.1.0",
"rollup": "^3.3.0",
"tempdir-yaml": "^0.3.0"
},
"dependencies": {
"@rollup/pluginutils": "^4.0.0",
"estree-walker": "^2.0.1",
"is-reference": "^1.2.1",
"magic-string": "^0.25.7"
"@rollup/pluginutils": "^5.0.2",
"estree-walker": "^3.0.1",
"is-reference": "^3.0.0",
"magic-string": "^0.26.7"
},
"peerDependencies": {
"rollup": "^2.25.0"
"rollup": "^2.25.0 || ^3.3.0"
}
}
rollup-plugin-external-globals
==============================
[![Build Status](https://travis-ci.com/eight04/rollup-plugin-external-globals.svg?branch=master)](https://travis-ci.com/eight04/rollup-plugin-external-globals)
[![test](https://github.com/eight04/rollup-plugin-external-globals/actions/workflows/test.yml/badge.svg)](https://github.com/eight04/rollup-plugin-external-globals/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/eight04/rollup-plugin-external-globals/branch/master/graph/badge.svg)](https://codecov.io/gh/eight04/rollup-plugin-external-globals)

@@ -125,2 +125,6 @@ [![install size](https://packagephobia.now.sh/badge?p=rollup-plugin-external-globals)](https://packagephobia.now.sh/result?p=rollup-plugin-external-globals)

* 0.7.0 (Nov 21, 2022)
- **Breaking: bump to rollup@3.**
* 0.6.1 (Oct 21, 2020)

@@ -127,0 +131,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