swc-plugin-fetch-replace

0.1.1 • Public • Published

swc-plugin-fetch-replace

npm version

SWC plugin for replaces global fetch with an arbitrary function.

Install

$ pnpm add -D swc-plugin-fetch-replace

Configuration

Function name with replace_fetch.

.swcrc

{
  "jsc": {
    "experimental": {
      "plugins": [
        [
          "swc-plugin-fetch-replace",
          {
            "replaceName": "replace_fetch"
          }
        ]
      ]
    }
  }
}

todo

  • [x] add examples
  • [ ] add jest examples
  • [ ] summarize in an article

Readme

Keywords

Package Sidebar

Install

npm i swc-plugin-fetch-replace

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

3.41 MB

Total Files

3

Last publish

Collaborators

  • akfm