Skip to content

Commit 18b5b2a

Browse files
authored
fix: unbreak bundling wretch (#33)
1 parent ac2c305 commit 18b5b2a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

wretch.browser.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
module.exports = require('wretch')
1+
const { default: wretch } = require('wretch')
2+
3+
// Removes the .default property from the exported function to deconfuse bundlers
4+
module.exports = (url, options) => wretch(url, options)

wretch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// NOTE: does not export Wretcher
2-
const { default: wretch } = require('./wretch.browser')
2+
const wretch = require('./wretch.browser')
33
const fetch = require('./fetch')
44

55
wretch().polyfills({ fetch })

0 commit comments

Comments
 (0)