@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 withcwd
prefix) or absolute path.
enable: boolean, if
false
, it will disable mock, default istrue
.