Using serverless-bundle
Using the serverless-bundle plugin to manage Webpack and Babel configs automatically.
Upgrading from v1.x to v2.0
Follow the steps below to upgrade your project to v2.0. Full change set available here.
-
Remove these from the
devDependencies
in yourpackage.json
"babel-core": "^6.26.3", "babel-loader": "^7.1.4"" "babel-plugin-source-map-support": "^1.0.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.7.0", "babel-preset-stage-3": "^6.24.1", "jest": "^21.2.1", "serverless-webpack": "^5.1.0", "webpack": "^4.16.2", "webpack-node-externals": "^1.6.0"
-
Replace it with
"serverless-bundle": "^1.2.2",
-
Remove these from the
dependencies
in yourpackage.json
"babel-runtime": "^6.26.0", "source-map-support": "^0.4.18"
-
Replace
"test": "jest"
in thescripts
block in yourpackage.json
with"test": "serverless-bundle test"
-
Replace
- serverless-webpack
with- serverless-bundle
in theplugins
block in yourserverless.yml
-
Remove these from the
custom
block in yourserverless.yml
webpack: webpackConfig: ./webpack.config.js includeModules: true
-
Add the following to your
serverless.yml
package: individually: true
-
Remove the
.babelrc
file from your project root -
Remove the
webpack.config.js
file from your project root -
Remove the
package-lock.json
file from your project root -
Remove your
node_modules/
by runningrm -rf node_modules/
-
Reinstall your NPM packages by running
npm install