elbywan / wretch

A tiny wrapper built around fetch with an intuitive syntax. :candy:
MIT License
4.79k stars 96 forks source link

Rollup.js warnings #82

Closed xpuu closed 4 years ago

xpuu commented 4 years ago

In case you're running wretch in Rollup (e.g. with Sapper) you might be confused about warning messages in the console.

// The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
1: var __assign = (this && this.__assign) || function () {
                           ^
2:     __assign = Object.assign || function(t) {
3:         for (var s, i = 1, n = arguments.length; i < n; i++) {

You can suppress them by using configuration directive onwarn in your rollup.config.js, warning code is THIS_IS_UNDEFINED.

elbywan commented 4 years ago

Thanks for reporting this rollup issue and how to solve it 👍.

Closing the issue though since it is not directly related to wretch but to an interop between rollup and typescript emits when targetting es5.