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

@smock/vue-cli-plugin-smock

Package Overview
Dependencies
Maintainers
12
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smock/vue-cli-plugin-smock

Vue cli plugin of @smock/mock

latest
Source
npmnpm
Version
0.1.34
Version published
Maintainers
12
Created
Source

Usage

Installation:

npm i @smock/vue-cli-plugin-smock

使用方式

注意:本插件只有在process.env.NODE_ENV等于development或不定义时生效。

该服务会在运行npm run serveyarn serve时自动运行。 运行地址与vue开发服务地址一致。 例如:开发服务运行在http://localhost:8080,则mock接口也运行在此端口。 打开此地址的/__doc__路径即可查看文档,例如:http://localhost:8080/__doc__

如何禁用?

启动serve时指定环境变量NO_SMOCK=true即可。 例如:

{
  // ...
  "scripts": {
    "serve": "cross-env NO_SMOCK=true vue-cli-service serve"
  }
  // ...
}

也可以作为vue-cli-service子命令启动

注意:使用命令启动时请指定NO_SMOCK环境变量为true。目的是禁止自动启动的服务。

{
  // ...
  "scripts": {
    "smock": "vue-cli-service smock --port 6000"
  }
  // ...
}

Then you can run command to start the interceptor service.

npm run smock

Configuration Documents:

See here:(https://www.npmjs.com/package/@smock/interceptor)

Keywords

Vue CLI plugin

FAQs

Package last updated on 22 Jul 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