Socket
Socket
Sign inDemoInstall

vite-plugin-resolve

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-resolve - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

2

package.json
{
"name": "vite-plugin-resolve",
"version": "1.6.0",
"version": "1.6.1",
"description": "Custom resolve module content.",

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

@@ -1,6 +0,3 @@

# vite-plugin-resolve
# vite-plugin-resolve [![NPM version](https://img.shields.io/npm/v/vite-plugin-resolve.svg)](https://npmjs.org/package/vite-plugin-resolve) [![awesome-vite](https://awesome.re/badge.svg)](https://github.com/vitejs/awesome-vite)
[![NPM version](https://img.shields.io/npm/v/vite-plugin-resolve.svg)](https://npmjs.org/package/vite-plugin-resolve)
[![NPM Downloads](https://img.shields.io/npm/dw/vite-plugin-resolve.svg)](https://npmjs.org/package/vite-plugin-resolve)
Custom resolve module content

@@ -10,3 +7,3 @@

- It can be compatible with Browser, Node.js and Electron
- Compatible Browser, Node.js and Electron
- You can think of it as an enhanced Vite external plugin

@@ -38,8 +35,8 @@ - You can think of it as manually [Pre-Bundling](https://vitejs.dev/guide/dep-pre-bundling.html)

#### Read a local file
#### Load a local file
```ts
resolve({
// Supported nested moduleId
// Supported return an Promis<string>
// Supported nested module id
// Supported return Promise
'@scope/name': async () => await require('fs').promises.readFile('path', 'utf-8'),

@@ -60,4 +57,7 @@ })

**Such as [execa](https://www.npmjs.com/package/execa), [node-fetch](https://www.npmjs.com/package/node-fetch)**
Such as [execa](https://www.npmjs.com/package/execa), [node-fetch](https://www.npmjs.com/package/node-fetch)
Here, Vite is used as the build tool
You can also choose other tools, such as [rollup](https://rollupjs.org), [webpack](https://webpack.js.org), [esbuild](https://esbuild.github.io), [swc](https://swc.rs) and so on
```ts

@@ -64,0 +64,0 @@ import { builtinModules } from 'module'

@@ -1,9 +0,6 @@

# vite-plugin-resolve
# vite-plugin-resolve [![NPM version](https://img.shields.io/npm/v/vite-plugin-resolve.svg)](https://npmjs.org/package/vite-plugin-resolve) [![awesome-vite](https://awesome.re/badge.svg)](https://github.com/vitejs/awesome-vite)
[![NPM version](https://img.shields.io/npm/v/vite-plugin-resolve.svg)](https://npmjs.org/package/vite-plugin-resolve)
[![NPM Downloads](https://img.shields.io/npm/dw/vite-plugin-resolve.svg)](https://npmjs.org/package/vite-plugin-resolve)
自定义加载模块内容
**English | [简体中文](https://github.com/caoxiemeihao/vite-plugins/tree/main/packages/resolve#readme)**
**[English](https://github.com/caoxiemeihao/vite-plugins/tree/main/packages/resolve#readme) | 简体中文**

@@ -42,3 +39,3 @@ - 兼容 Browser, Node.js and Electron

// 支持嵌套模块命名
// 支持返回 Promis<string>
// 支持返回 Promise
'@scope/name': async () => await require('fs').promises.readFile('path', 'utf-8'),

@@ -59,4 +56,7 @@ })

**例如 [execa](https://www.npmjs.com/package/execa), [node-fetch](https://www.npmjs.com/package/node-fetch)**
例如 [execa](https://www.npmjs.com/package/execa), [node-fetch](https://www.npmjs.com/package/node-fetch)
这里使用 "vite" 作为构建工具
你也可以选用其他的工具,比如 [rollup](https://rollupjs.org), [webpack](https://webpack.js.org), [esbuild](https://esbuild.github.io), [swc](https://swc.rs) 等等
```ts

@@ -63,0 +63,0 @@ import { builtinModules } from 'module'

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc