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

vite-plugin-electron-renderer

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-electron-renderer - npm Package Compare versions

Comparing version 0.14.3 to 0.14.4

70

dist/index.js

@@ -8,4 +8,72 @@ "use strict";

const esbuild = require("esbuild");
const libEsm = require("lib-esm");
const os = require("node:os");
const keywords = [
"break",
"case",
"catch",
"class",
"const",
"continue",
"debugger",
"default",
"delete",
"do",
"else",
"export",
"extends",
"false",
"finally",
"for",
"function",
"if",
"import",
"in",
"instanceof",
"new",
"null",
"return",
"super",
"switch",
"this",
"throw",
"true",
"try",
"typeof",
"var",
"void",
"while",
"with"
];
function libEsm(options) {
const {
window,
require: require2,
exports: members = [],
conflict = ""
} = options;
const _M_ = "_M_" + conflict;
const windowSnippet = window == null ? "" : `const ${_M_} = window["${window}"];`;
const requireSnippet = require2 == null ? "" : `
import { createRequire } from "node:module";
const ${_M_} = createRequire(import.meta.url)("${require2}");
`.trim();
!members.includes("default") && members.push("default");
const alias = members.filter((member) => keywords.includes(member)).reduce((memo, keyword) => Object.assign(memo, { [keyword]: `keyword_${keyword + conflict}` }), {});
const exportsSnippet = `
${members.map((member) => {
const LV = alias[member] ? `const ${alias[member]}` : `export const ${member}`;
const RV = member === "default" ? `${_M_}.default || ${_M_}` : `${_M_}.${member}`;
return `${LV} = ${RV};`;
}).join("\n")}
export {
${Object.entries(alias).map(([member, alias2]) => `${alias2} as ${member},`).join("\n ")}
};
`.trim();
return {
window: windowSnippet,
require: requireSnippet,
exports: exportsSnippet,
keywords: alias
};
}
function relativeify(relative) {

@@ -12,0 +80,0 @@ if (relative === "") {

6

package.json
{
"name": "vite-plugin-electron-renderer",
"version": "0.14.3",
"version": "0.14.4",
"description": "Support use Node.js API in Electron-Renderer",

@@ -28,8 +28,6 @@ "main": "./dist/index.js",

},
"dependencies": {
"lib-esm": "~0.4.0"
},
"devDependencies": {
"electron": "^24.3.1",
"esbuild": "^0.17.19",
"lib-esm": "^0.4.0",
"node-fetch": "^3.3.1",

@@ -36,0 +34,0 @@ "rollup": "^3.22.0",

Sorry, the diff of this file is not supported yet

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