
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
vite-plugin-resolve
Advanced tools
Custom resolve module content
English | 简体ä¸ć–‡
npm i vite-plugin-resolve -D
import { defineConfig } from 'vite'
import resolve from 'vite-plugin-resolve'
export default defineConfig({
plugins: [
resolve({
// Resolve custom module content
// This like Vite external plugin
vue: `const vue = window.Vue; export { vue as default }`,
}),
]
})
resolve({
// Support nested module id
// Support return Promise
'@scope/name': () => require('fs').promises.readFile('path', 'utf-8'),
})
resolve({
// Resolve Electron ipcRenderer in Renderer-process
electron: `const { ipcRenderer } = require('electron'); export { ipcRenderer };`,
})
entries
{
[moduleId: string]:
| ReturnType<Plugin['load']>
| ((...args: Parameters<Plugin['load']>) => ReturnType<Plugin['load']>)
}
You can see the return value type definition here rollup/types.d.ts#L272
There are two main differences
vite:resolve pluginFAQs
Custom resolve module content.
The npm package vite-plugin-resolve receives a total of 5,976 weekly downloads. As such, vite-plugin-resolve popularity was classified as popular.
We found that vite-plugin-resolve demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.