rollup-plugin-external-globals
Advanced tools
Comparing version 0.6.1 to 0.7.1
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12538
197
171
+ Added@rollup/pluginutils@5.1.3(transitive)
+ Addedestree-walker@3.0.3(transitive)
+ Addedis-reference@3.0.3(transitive)
+ Addedmagic-string@0.26.7(transitive)
+ Addedpicomatch@4.0.2(transitive)
+ Addedrollup@3.29.5(transitive)
- Removed@rollup/pluginutils@4.2.1(transitive)
- Removedis-reference@1.2.1(transitive)
- Removedmagic-string@0.25.9(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedrollup@2.79.2(transitive)
Updated@rollup/pluginutils@^5.0.2
Updatedestree-walker@^3.0.1
Updatedis-reference@^3.0.0
Updatedmagic-string@^0.26.7