npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

serverless-bundle-no-pg-native

v1.3.0

Published

An extension of the serverless-webpack plugin that bundles your Node.js Lambda functions.

Downloads

111

Readme

serverless-bundle Build Status npm

An extension of the serverless-webpack plugin. This plugin bundles your Node.js Lambda functions with sensible defaults so you don't have to maintain your own Webpack configs.

  • Linting via ESLint
  • Caching for faster builds
  • Use ES6 import/export
  • Supports transpiling unit tests with babel-jest
  • Source map support for proper error messages

And all this works without having to install Webpack, Babel, ESLint, etc. or manage any of their configs. Simply add serverless-bundle to your app and you are done!

-    "eslint"
-    "webpack"
-    "@babel/core"
-    "babel-eslint"
-    "babel-loader"
-    "eslint-loader"
-    "@babel/runtime"
-    "@babel/preset-env"
-    "serverless-webpack"
-    "source-map-support"
-    "webpack-node-externals"
-    "eslint-config-strongloop"
-    "@babel/plugin-transform-runtime"
-    "babel-plugin-source-map-support"

+    "serverless-bundle": "^1.1.12"

You can read more about this over on Serverless Stack.


Getting Started

Install the serverless-bundle plugin using:

$ npm install --save-dev serverless-bundle

Then add it to your serverless.yml.

plugins:
  - serverless-bundle

To run your tests using the same Babel config used in the plugin add the following to your package.json:

"scripts": {
  "test": "serverless-bundle test"
}

Usage

Once installed and added to your serverless.yml, serverless-bundle will automatically package your functions using Webpack when you run the various serverless commands.

Options

You can configure the following through your serverless.yml.

custom:
  bundle:
    sourcemaps: true  # Enable source maps
    caching: true     # Enable Webpack caching
    stats: false      # Don't print out any Webpack output
    linting: true     # Enable linting as a part of the build process

Advanced Options

  • ESLint

    This plugin uses eslint-config-strongloop. You can override this by placing your own .eslintrc.json with the rules you'd like to use. If you'd like to ignore specific files, you can use a .eslintignore file.

  • Customizing Babel and Webpack configs

    This plugin does not support customizing the Babel and Webpack configs, since serverless-webpack does a pretty good job with that. However, if you think the default config is missing some key features, feel free to open an issue about it.

Support

  • Open a new issue if you've found a bug or have some suggestions.
  • Or submit a pull request!

Running Locally

To run this project locally, clone the repo and initialize the project.

$ git clone https://github.com/AnomalyInnovations/serverless-bundle
$ cd serverless-bundle
$ npm install

Run the tests using.

$ npm test

To test the serverless-bundle test command.

$ npm run test-scripts

To install locally in another project.

$ npm install /path/to/serverless-bundle

Thanks

This plugin would not be possible without the amazing serverless-webpack plugin and the ideas and code from Create React App.


This plugin is maintained by Anomaly Innovations; makers of Seed and Serverless Stack.