Skip to content

Hquestion/webpack-plugin-ivormock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-plugin-ivormock

Webpack plugin for ivormock.

Ivormock is made for development. Please use it in development environment only.

Install

npm install -D ivormock webpack-plugin-ivormock

Getting Start

In other webpack-based tools, such as vue-cli, create-react-app, webpack-plugin-ivormock is used just like other common plugins.

In your webpack.config.js

const IvormockWebpackPlugin = require("webpack-plugin-ivormock");

const isDev = process.env.NODE_ENV === "development";

module.exports = {
    // ... 
    plugins: [
        //...
        // Only used in development envorioment
        isDev && new IvormockWebpackPlugin({
            mockPath: "mock",   // mock file path, relative to project root
            port: 3456,          // ivormock server port
            prefix: "/mock"     // request with "/mock" prefix will pass to ivormock 
        })
    ]
}

About

Webpack plugin for ivormock

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published