vite-plugin-electron-renderer
Advanced tools
Comparing version 0.8.8 to 0.9.0
{ | ||
"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 @@ }; |
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
32629
14
485