serverless-copy-webpack-plugin

1.1.0 • Public • Published

serverless-copy-webpack-plugin

version downloads

Should hopefully be obsolete when serverless-webpack #327 gets merged.

Webpack plugin to be used in combination with serverless-webpack to allow copying files to individual functions

Note: Originated from the discussion in serverless-webpack issues #425. Based on the code by @Omicron7 and @raymond-w-ko

Usage

To begin, install the plugin as dev dependency

$ npm install serverless-copy-webpack-plugin --save-dev

Then add the plugin to your webpack.config.js

const ServerlessCopyWebpackPlugin = require('serverless-copy-webpack-plugin');

module.exports = {
  plugins: [
    new ServerlessCopyWebpackPlugin()
  ],
};

The plugin will now copy any resources defined in your individual package includes to the artifacts for those functions. For example:

functions:
  hello:
    handler: handler.hello
    package:
      include:
        src/static/*.html

will copy any html files in the src/static folder to the corresponding function package

Readme

Keywords

Package Sidebar

Install

npm i serverless-copy-webpack-plugin

Weekly Downloads

561

Version

1.1.0

License

MIT

Unpacked Size

4.32 kB

Total Files

4

Last publish

Collaborators

  • codevision