MockRequestsWebpackPlugin

MockRequestsWebpackPlugin

Webpack plugin for automatically resolving the mock directory, including transpiling all files it contains as well as adding the entry file within it to the build/run output for the user.

Constructor

new MockRequestsWebpackPlugin(mocksDir, mockEntryFile, activateMocks, optionsopt)

Source:
Activates mock-requests based on the provided parameters.
Parameters:
Name Type Attributes Description
mocksDir string Directory of all mock files/logic, including the `mockEntryFile`.
mockEntryFile string Entry file that calls `MockRequests.configure()`.
activateMocks boolean If mocks determined by `mockEntryFile` should be activated or not.
options Object <optional>
Properties
Name Type Attributes Default Description
pathsAreAbsolute boolean <optional>
false If `mocksDir` and `mockEntryFile` are absolute paths instead of relative.
transpileMocksDir boolean <optional>
true If the files within `mocksDir` should be transpiled.

Extends

  • WebpackPluginInstance