Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@hyext-mock/beyond-plugin-babel-mock

hy-ext48ISC0.0.5

TODO: description

readme

@hyext-mock/beyond-plugin-babel-mock

A mock resolution by babel.

Usage

{
  "plugins": [
    [
      "@hyext-mock/beyond-plugin-babel-mock",
      {
        "match": [
          ["@hyext-inner/hyext-data-core", "./src/mock/modules/hyext-data-core"],
          ["\\/events", "./src/mock/events"]
        ],
        "enable": false
      }
    ]
  ]
}

Options

match - a match config list

it's member are both match item, details as follow:

  • match:Array<MatchItem>

    • matchItem[0]:string - match RE string.

    • matchItem[1]:string - replace string, it could be a file path or npm module name, the file path should be a relative path(it will add with cwd prefix) or absolute path.

  • enable: boolean, if false, it will disable mock, default is true.