0.2.0 • Published 1 year ago
fetch-unfiller v0.2.0
fetch-unfiller
Installation
Usage
Vite
import { defineConfig } from "vite"
export default defineConfig({
resolve: {
alias: {
// Alias any `fetch` package in use to `fetch-unfiller`
"cross-fetch": "fetch-unfiller",
// Use `fetch-unfiller/node` if building for node
"node-fetch": "fetch-unfiller/node",
},
},
})
esbuild
import { build } from "esbuild"
await build({
// ...
alias: {
// Alias any `fetch` package in use to `fetch-unfiller`
"cross-fetch": "fetch-unfiller",
// Use `fetch-unfiller/node` if building for node
"node-fetch": "fetch-unfiller/node",
},
})
Webpack/Rspack
import { type Configuration } from "webpack"
export default {
// ...
resolve: {
alias: {
// Alias any `fetch` package in use to `fetch-unfiller`
"cross-fetch": "fetch-unfiller",
// Use `fetch-unfiller/node` if building for node
"node-fetch": "fetch-unfiller/node",
},
},
} satisfies Configuration
Rollup
import { RollupOptions } from "rollup"
import Alias from "@rollup/plugin-alias"
export default {
// ...
plugins: [
// ...
Alias({
entries: {
// Alias any `fetch` package in use to `fetch-unfiller`
"cross-fetch": "fetch-unfiller",
// Use `fetch-unfiller/node` if building for node
"node-fetch": "fetch-unfiller/node",
},
}),
],
} satisfies RollupOptions