Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

Custom resolve module content.

  • 1.4.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.3K
increased by1.07%
Maintainers
1
Weekly downloads
 
Created
Source

vite-plugin-resolve

npm package
NPM version NPM Downloads

Install

npm i -D vite-plugin-resolve

Usage

import { defineConfig } from 'vite'
import viteResolve from 'vite-plugin-resolve'

export default defineConfig({
  plugins: [
    viteResolve({
      // use code string
      vue: `const vue = window.Vue; export default vue;`,
      // use nested module name, return code string through function
      '@scope/name': () => `const Lib = window.LibraryName; export default Lib;`,
      // use in electron
      'electron': `const Electron = require('electron'); export default Electron;`,
    })
  ]
})

How to work

  1. Resolve-module will be generated code into node_modules/.vite-plugin-resolve/vue.js
  2. Append an resolve-module into alias
{
  resolve: {
    alias: [
      {
        find: 'vue',
        replacement: 'User/work-directory/node_modules/.vite-plugin-resolve/vue.js',
      },
    ],
  },
}

Keywords

FAQs

Package last updated on 28 Jan 2022

Did you know?

Socket

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.

Install

Related posts

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