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

@parcel/runtime-js

Package Overview
Dependencies
Maintainers
1
Versions
889
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/runtime-js - npm Package Compare versions

Comparing version 2.0.0-nightly.239 to 2.0.0-nightly.242

2

lib/bundle-url.js
"use strict";
/* globals document:readonly */
var bundleURL = null;

@@ -14,3 +15,2 @@

function getBundleURL() {
// Attempt to find the URL of the current script and use that as the base URL
try {

@@ -17,0 +17,0 @@ throw new Error();

@@ -135,8 +135,10 @@ "use strict";

let bundleGroup = resolved.value;
let bundlesInGroup = bundleGraph.getBundlesInBundleGroup(bundleGroup);
let [firstBundle] = bundlesInGroup;
let mainBundle = (0, _nullthrows.default)(bundleGraph.getBundlesInBundleGroup(bundleGroup).find(b => {
let main = b.getMainEntry();
return main && bundleGroup.entryAssetId === main.id;
}));
if (firstBundle.isInline) {
if (mainBundle.isInline) {
assets.push({
filePath: _path.default.join(__dirname, `/bundles/${firstBundle.id}.js`),
filePath: _path.default.join(__dirname, `/bundles/${mainBundle.id}.js`),
code: `module.exports = ${JSON.stringify(dependency.id)};`,

@@ -149,3 +151,3 @@ dependency

assets.push(getURLRuntime(dependency, bundle, firstBundle));
assets.push(getURLRuntime(dependency, bundle, mainBundle));
}

@@ -152,0 +154,0 @@

{
"name": "@parcel/runtime-js",
"version": "2.0.0-nightly.239+df509222",
"version": "2.0.0-nightly.242+ac5e8071",
"license": "MIT",

@@ -19,7 +19,7 @@ "publishConfig": {

"dependencies": {
"@parcel/plugin": "2.0.0-nightly.239+df509222",
"@parcel/utils": "2.0.0-nightly.239+df509222",
"@parcel/plugin": "2.0.0-nightly.242+ac5e8071",
"@parcel/utils": "2.0.0-nightly.242+ac5e8071",
"nullthrows": "^1.1.1"
},
"gitHead": "df509222e6808e49009e77bff8f4f9bdc94865bc"
"gitHead": "ac5e807141df2ab1d83853b631551b28643b5869"
}

@@ -0,1 +1,3 @@

/* globals document:readonly */
var bundleURL = null;

@@ -12,2 +14,8 @@ function getBundleURLCached() {

// Attempt to find the URL of the current script and use that as the base URL
if (process.env.PARCEL_BUILD_ENV === 'test') {
if (typeof document !== 'undefined' && 'currentScript' in document) {
return getBaseURL(document.currentScript.src);
}
}
try {

@@ -14,0 +22,0 @@ throw new Error();

@@ -136,8 +136,12 @@ // @flow strict-local

let bundleGroup = resolved.value;
let bundlesInGroup = bundleGraph.getBundlesInBundleGroup(bundleGroup);
let mainBundle = nullthrows(
bundleGraph.getBundlesInBundleGroup(bundleGroup).find(b => {
let main = b.getMainEntry();
return main && bundleGroup.entryAssetId === main.id;
}),
);
let [firstBundle] = bundlesInGroup;
if (firstBundle.isInline) {
if (mainBundle.isInline) {
assets.push({
filePath: path.join(__dirname, `/bundles/${firstBundle.id}.js`),
filePath: path.join(__dirname, `/bundles/${mainBundle.id}.js`),
code: `module.exports = ${JSON.stringify(dependency.id)};`,

@@ -150,3 +154,3 @@ dependency,

// URL dependency or not, fall back to including a runtime that exports the url
assets.push(getURLRuntime(dependency, bundle, firstBundle));
assets.push(getURLRuntime(dependency, bundle, mainBundle));
}

@@ -153,0 +157,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