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.8.8 to 0.9.0

plugins/build-config.vite-3.0.5.d.ts

17

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

@@ -13,10 +13,5 @@ "main": "plugins/index.js",

"license": "MIT",
"scripts": {
"dev": "rm -rf plugins && tsc --watch",
"build": "rm -rf plugins && tsc",
"prepublishOnly": "npm run build"
},
"dependencies": {},
"devDependencies": {
"vite": "^3.0.2"
"vite": "^3.0.6"
},

@@ -31,3 +26,7 @@ "files": [

"renderer"
]
}
],
"scripts": {
"dev": "rm -rf plugins && tsc --watch",
"build": "rm -rf plugins && tsc"
}
}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
// https://github.com/vitejs/vite/blob/main/packages/vite/src/node/constants.ts#L84-L124
const KNOWN_ASSET_TYPES = [
// images
'png',
'jpe?g',
'jfif',
'pjpeg',
'pjp',
'gif',
'svg',
'ico',
'webp',
'avif',
// media
'mp4',
'webm',
'ogg',
'mp3',
'wav',
'flac',
'aac',
// fonts
'woff2?',
'eot',
'ttf',
'otf',
// other
'webmanifest',
'pdf',
'txt'
];
function buildConfig() {

@@ -60,16 +25,2 @@ return {

config.build.emptyOutDir = false;
// `Uncaught TypeError: Failed to construct 'URL': Invalid URL` #44
if (!config.experimental)
config.experimental = {
renderBuiltUrl(filename, type) {
if (KNOWN_ASSET_TYPES.includes(path_1.default.extname(filename).slice(1)) &&
type.hostType === 'js') {
// Avoid Vite relative-path assets handling
// https://github.com/vitejs/vite/blob/89dd31cfe228caee358f4032b31fdf943599c842/packages/vite/src/node/build.ts#L850-L862
return { runtime: JSON.stringify(filename) };
}
// TODO: replace `config.build.assetsDir` for chunk js
// TODO: replace `config.build.assetsDir` for split css
},
};
},

@@ -76,0 +27,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