kuitos / axios-extensions

🍱 axios extensions lib, including throttle, cache, retry features etc...
MIT License
831 stars 49 forks source link

LRUCache is not transpiled in ESM version, so it fails uglifyJS build. #40

Closed supermoos closed 5 years ago

supermoos commented 5 years ago

The included LRUCache uses const's, which fails when I try to process it trough Uglify - could we use a version that's properly transpiled?

Unexpected token: keyword (const) [./node_modules/axios-extensions/node_modules/lru-cache/index.js:4,0][main.legacy.js:7204,0]
Details:
    domain: [object Object]
    domainThrown: true
kuitos commented 5 years ago

As lru-cache does not works well in react-native environment below v5.0.0, so we need to upgrade our dependency. If you need your bundle target to es5, you might make your compiler transpile the lru-cache package as well. example with babelrc:

{
  "include": ["/node_modules/lru-cache"]
}
supermoos commented 5 years ago

I ended up just using v.3.0.3

kuitos commented 5 years ago

released v3.0.5 Thanks for your feedback!