Closed austencollins closed 4 years ago
yeah I'm using them all. I should choose either isomorphic-fetch
or node-fetch
though, that was a mistake.
If size is a concern, I can probably find lightweight alternatives to some packages. What's your use case? are you including the platform-sdk
in Lambda and worried about the package size?
I'm just using it in Components now and generally trying to keep the dependencies down, otherwise we'll end up with a slow CLI.
@ac360 I've cleared up our deps. Should be lighter now. What we have now is what we need.
core-js slows down loading and slows down javascript builtins adding polyfills serverless don't use at all. May I ask if is possible to remove the dependency to babel-polyfill
?
At the moment, both this package and serverless seems to need only the regenerator runtime and not all the polyfills.
In our CI and locally, we don't run directly sls because is incredibly slow, but instead, we run a custom script that before running avoid loading core-js.
On our tests, not loading core-js improves sls package
operation performances up to 3, 4 times (with core-js 2.6.0)
#!/usr/bin/env node
global._babelPolyfill = true
if (!global.regeneratorRuntime) {
global.regeneratorRuntime = require('regenerator-runtime')
}
require('serverless/bin/serverless')
regenerator-runtime package is the only package actually needed.
May I suggest to remove babel-polyfill
dependency and replace require('babel-polyfill')
with regenerator-runtime
?
Pull request: https://github.com/serverless/platform-sdk/pull/24
@eahefnawy Do you need all of the current dependencies?