vite-plugin-electron-renderer
Advanced tools
Comparing version 0.5.2 to 0.5.3
{ | ||
"name": "vite-plugin-electron-renderer", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "Support use Node.js API in Electron-Renderer", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,3 +23,3 @@ import { Plugin, ResolvedConfig } from 'vite'; | ||
export interface ResolveModules { | ||
(config: ResolvedConfig, options: Options): { | ||
(config: ResolvedConfig, options?: Options): { | ||
/** Node.js builtin modules */ | ||
@@ -26,0 +26,0 @@ builtins: string[]; |
@@ -168,6 +168,6 @@ const fs = require('fs'); | ||
*/ | ||
function resolveModules(config, options) { | ||
function resolveModules(config, options = {}) { | ||
const root = config.root; | ||
const cwd = process.cwd(); | ||
const builtins = builtinModules.filter(e => !e.startsWith('_')); builtins.push(...builtins.map(m => `node:${m}`)); | ||
const builtins = builtinModules.filter(e => !e.startsWith('_')); builtins.push('electron', ...builtins.map(m => `node:${m}`)); | ||
// dependencies of package.json | ||
@@ -222,3 +222,10 @@ let dependencies = []; | ||
useNodeJs.resolveModules = resolveModules; | ||
useNodeJs.default = useNodeJs; | ||
// Function { | ||
// default: <ref *1> [Function: useNodeJs] { | ||
// resolveModules: [Function: resolveModules2], | ||
// default: [Circular *1] | ||
// }, | ||
// resolveModules: [Getter] | ||
// } | ||
// useNodeJs.default = useNodeJs; | ||
module.exports = useNodeJs; |
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
22066
350