New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@col0ring/vite-plugin-mock

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@col0ring/vite-plugin-mock

## Install

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Vite-Plugin-Mock

Install

npm install @col0ring/vite-plugin-mock -D
# or
yarn add @col0ring/vite-plugin-mock -D

Usage

import { defineConfig } from 'vite'
import path from 'path'
import viteMockPlugin from '@col0ring/vite-plugin-mock'

function resolve(relativePath) {
  return path.resolve(__dirname, relativePath)
}

export default defineConfig({
  plugins: [
    // ...
    viteMockPlugin({
      dir: resolve('./mock')
      // or multiple dirs
      // dir: [resolve('./mock'),resolve('./mock2')]
    })
  ]
})

Options

dir

  • Type: string | string[]

The directory you want to watch.

mockPrefix

  • Type: string
  • Default: /mock

Path prefix for all mock requests.

include

  • Type: RegExp | ((filename: string) => boolean)
  • Default: 'node_modules'

A RegExp or a filter function, to include when loading files.

exclude

  • Type: RegExp | ((filename: string) => boolean)
  • Default: 'node_modules'

A RegExp or a filter function, to exclude when loading files.

FAQs

Package last updated on 12 Sep 2021

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