Socket
Socket
Sign inDemoInstall

snowpack

Package Overview
Dependencies
394
Maintainers
3
Versions
229
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.8.0-pre.1 to 3.8.0-pre.2

CHANGELOG.md

14

lib/cjs/ssr-loader/index.js

@@ -9,2 +9,8 @@ "use strict";

const util_1 = require("../util");
function moduleInit(fn) {
let promise = null;
return function () {
return promise || (promise = fn());
};
}
// This function makes it possible to load modules from the snowpack server, for the sake of SSR.

@@ -22,3 +28,3 @@ function createLoader({ config, load }) {

}
return async function () {
return moduleInit(async function () {
const mod = await util_1.REQUIRE_OR_IMPORT(imported, {

@@ -31,3 +37,3 @@ from: config.root || config.workspaceRoot || process.cwd(),

};
};
});
}

@@ -58,3 +64,3 @@ function invalidateModule(path) {

const loaded = await load(url);
return function () {
return moduleInit(function () {
try {

@@ -67,3 +73,3 @@ return initializeModule(url, loaded, urlStack.concat(url));

}
};
});
})();

@@ -70,0 +76,0 @@ cache.set(url, promise);

@@ -6,2 +6,8 @@ import { existsSync, readFileSync } from 'fs';

import { REQUIRE_OR_IMPORT } from '../util';
function moduleInit(fn) {
let promise = null;
return function () {
return promise || (promise = fn());
};
}
// This function makes it possible to load modules from the snowpack server, for the sake of SSR.

@@ -19,3 +25,3 @@ export function createLoader({ config, load }) {

}
return async function () {
return moduleInit(async function () {
const mod = await REQUIRE_OR_IMPORT(imported, {

@@ -28,3 +34,3 @@ from: config.root || config.workspaceRoot || process.cwd(),

};
};
});
}

@@ -55,3 +61,3 @@ function invalidateModule(path) {

const loaded = await load(url);
return function () {
return moduleInit(function () {
try {

@@ -64,3 +70,3 @@ return initializeModule(url, loaded, urlStack.concat(url));

}
};
});
})();

@@ -67,0 +73,0 @@ cache.set(url, promise);

{
"name": "snowpack",
"version": "3.8.0-pre.1",
"version": "3.8.0-pre.2",
"description": "The ESM-powered frontend build tool. Fast, lightweight, unbundled.",

@@ -25,3 +25,3 @@ "author": "Fred K. Schott <fkschott@gmail.com>",

"build": "tsc --noUnusedLocals false --noUnusedParameters false && tsc -p tsconfig.cjs.json",
"build:watch": "tsc --watch --noUnusedLocals false --noUnusedParameters false",
"build:watch": "tsc --watch -p tsconfig.cjs.json",
"lint": "tsc --noEmit"

@@ -28,0 +28,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc