@smock/vue-cli-plugin-smock

0.1.34 • Public • Published

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)

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

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

    Weekly Downloads

    11

    Version

    0.1.34

    License

    MIT

    Unpacked Size

    4.32 kB

    Total Files

    5

    Last publish

    Collaborators

    • shihaowang
    • hand-osc
    • tonyhuanchen
    • nemoj
    • dwsf
    • waynew
    • aboyl
    • huihuawk
    • sunchir
    • hellostandby
    • lin_summer
    • jmysxy