Vite Plugin Mock Dev Server

screenshot of Vite Plugin Mock Dev Server
vite

mock-dev-server is injected into the vite development environment to simulate requests and data responses.在vite 开发环境中注入 mock-dev-server, 模拟请求和数据响应

Overview

The vite-plugin-mock-dev-server is a lightweight, flexible, and fast tool that provides API mocking capabilities for Vite projects. It supports various features such as ESModule/CommonJS support, TypeScript integration, Hot Module Replacement (HMR), and the ability to auto-import mock files. This plugin can handle path rule matching, request parameter matching, and supports a wide range of response content types.

Features

  • Lightweight, Flexible, Fast
  • Not injection-based, non-intrusive to client code
  • ESModule/CommonJS support
  • TypeScript integration
  • Hot Module Replacement (HMR)
  • Support for various file formats like .[cm]?js, .ts, .json, .json5
  • Auto import mock file
  • Support for mock libraries like mockjs
  • Ability to enable/disable specific API mocks
vite
Vite

Vite is a build tool that aims to provide a faster and leaner development experience for modern web projects

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

graphql
Graphql

A website that uses GraphQL as a query language to manage data fetching and state management. This includes features such as a strongly typed schema, client-side caching, and declarative data fetching to streamline data management and optimize website performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.