Socket
Socket
Sign inDemoInstall

vite-plugin-electron-renderer

Package Overview
Dependencies
Maintainers
2
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.5.5 to 0.5.6

4

CHANGELOG.md
## [2022-07-11] v0.5.6
- d31f917 refactor: `root: string` instead of `config: UserConfig`
## [2022-07-11] v0.5.5

@@ -3,0 +7,0 @@

2

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

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,2 +0,2 @@

import { Plugin, UserConfig } from 'vite';
import { Plugin } from 'vite';

@@ -23,3 +23,3 @@ declare const useNodeJs: UseNodeJs;

export interface ResolveModules {
(config: UserConfig, options?: Options): {
(root: string, options?: Options): {
/** Node.js builtin modules */

@@ -26,0 +26,0 @@ builtins: string[];

@@ -62,3 +62,6 @@ const fs = require('fs');

const resolved = resolveModules(config, options);
// https://github.com/vitejs/vite/blob/53799e1cced7957f9877a5b5c9b6351b48e216a7/packages/vite/src/node/config.ts#L439-L442
const root = normalizePath(config.root ? path.resolve(config.root) : cwd);
const resolved = resolveModules(root, options);
builtins.push(...resolved.builtins);

@@ -190,6 +193,4 @@ dependencies.push(...resolved.dependencies);

*/
function resolveModules(config, options = {}) {
function resolveModules(root, options = {}) {
const cwd = process.cwd();
// https://github.com/vitejs/vite/blob/53799e1cced7957f9877a5b5c9b6351b48e216a7/packages/vite/src/node/config.ts#L439-L442
const root = normalizePath(config.root ? path.resolve(config.root) : cwd)
const builtins = builtinModules.filter(e => !e.startsWith('_')); builtins.push('electron', ...builtins.map(m => `node:${m}`));

@@ -196,0 +197,0 @@ // dependencies of package.json

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