Skip to content

Using serverless-bundle

Compare
Choose a tag to compare
@jayair jayair released this 18 Jul 20:34
· 21 commits to master since this release
b577ac1

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 your package.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 your package.json

    "babel-runtime": "^6.26.0",		
    "source-map-support": "^0.4.18"
    
  • Replace "test": "jest" in the scripts block in your package.json with "test": "serverless-bundle test"

  • Replace - serverless-webpack with - serverless-bundle in the plugins block in your serverless.yml

  • Remove these from the custom block in your serverless.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 running rm -rf node_modules/

  • Reinstall your NPM packages by running npm install