use-axios-client
use-axios-client copied to clipboard
Optimize build artifact
Update our babel-plugin-transform-runtime config to specify exactly which runtime polyfills the library needs.
Currently we're using defaults:
{
absoluteRuntime: false,
corejs: false,
helpers: true,
regenerator: true,
useESModules: false
}
We could maybe use babel-plugin-transform-regenerator to more granularly specify runtime transforms.
We may want to consider one of these two options:
- Use
Promise
instead ofasync/await
inuseBaseAxios
- Use something like babel-plugin-transform-async-to-promises to transform
async/await
to nativePromise
calls to remove the need for regenerator runtime
Ran a few test builds and it looks like either one of these will reduce the build artifact size by 25-30%.
If we implement https://github.com/angelle-sw/use-axios-client/pull/97, I think we would just need to specify a node
target in the @babel/preset-env
config along with a browserslist
entry in package.json
and the rest should be taken care of (in theory 😄 ).
That would be sick - will do a comparison of the current build artifact size vs. the one generated by pika and report back.