npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@eolink_apikit/mock-proxy-plugin

v1.0.4

Published

这是专属于 Eolink Mock 系统的前端 HTML 插件,支持 vite 以及 webpack 两款构建工具。

Downloads

7

Readme

简介

这是专属于 Eolink Mock 系统的前端 HTML 插件,支持 vite 以及 webpack 两款构建工具。

使用

安装

$ npm install @eolink_apikit/mock-proxy-plugin

引用

webpack

// 默认引入webpack
const EoMockProxyPlugin = require('@eolink_apikit/mock-proxy-plugin')
module.exports = {
  plugins: [
    new EoMockProxyPlugin({
      // config
    })
  ]
}

vite

const EoMockProxyPlugin = require('@eolink_apikit/mock-proxy-plugin/vite')
export default defineConfig({
  plugins: [vue(), new EoMockProxyPlugin(
    // config
  )]
})

配置

  • 实例化 EoMockProxyPlugin 时传参,如下示例:
    new EoMockProxyPlugin({
        "MOCK_API_HOST":"https://mockapi.eolink.com/",//[optional][string]
        "PROXY_MATCH_PATH:":"/api/v1/",//[optional][string]
        "IS_OPEN:":false //[optional][boolean]
    })
  • MOCK_API_HOST:[string] Eolink Mock API 统一的转发地址前缀,示例:https://mockapi.eolink.com/
  • PROXY_MATCH_PATH:[string] 拦截关键词,默认是/api/,假设所拦截的路径不包含此关键词,则默认请求原始路径,否则进入 mock 拦截器
  • IS_OPEN:[boolean] 是否开启 Mock 拦截器

注意

  • 因为此插件为 HTML 插件,所以假设项目构建工具为 weboack,则需要安装项目依赖插件:“html-webpack-plugin”