From 6176dc4c6239585a2bac7cdaf25e981e4c829851 Mon Sep 17 00:00:00 2001 From: Tony Yuen Date: Fri, 26 Aug 2016 23:57:59 +0800 Subject: [PATCH] rename serverless custom key, includePackages to webpackIncludeModules to avoid conflict with other plugin --- README.md | 12 ++++++------ .../include-external-npm-packages/serverless.yml | 2 +- .../include-external-npm-packages/webpack.config.js | 2 +- lib/packExternalModules.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5b3c778..3a9576c 100644 --- a/README.md +++ b/README.md @@ -31,24 +31,24 @@ generated to write bundles in the `.webpack` directory. By default, the plugin will try to bundle all dependencies. However, you don't -want to include all packages in some cases such as selectively import, excluding -builtin package (aws-sdk) and handling webpack-incompatible packages. In this case, -you add all the packages, you want to exclude from bundled files, into `externals` field +want to include all modules in some cases such as selectively import, excluding +builtin package (aws-sdk) and handling webpack-incompatible modules. In this case, +you add all the modules, you want to exclude from bundled files, into `externals` field of your `webpack.config.json` and add those, you want to include in final distribution, into `serverless.yml`: ```json // webpack.config.json { - externals: ["package1", "package2"] // packages to be excluded from bundled file + externals: ["module1", "module2"] // modules to be excluded from bundled file } ``` ```yaml # serverless.yml custom: - includePackages: - - package1 # packages to be included in distribution + webpackIncludeModules: + - module1 # modules to be included in distribution ``` You can find an example setup in the [`examples`](./examples) folder. diff --git a/examples/include-external-npm-packages/serverless.yml b/examples/include-external-npm-packages/serverless.yml index f42ca38..d27dd6a 100644 --- a/examples/include-external-npm-packages/serverless.yml +++ b/examples/include-external-npm-packages/serverless.yml @@ -9,7 +9,7 @@ provider: runtime: nodejs4.3 custom: - includePackages: # packages to be included in distribution + webpackIncludeModules: # modules to be included in distribution - fbgraph functions: diff --git a/examples/include-external-npm-packages/webpack.config.js b/examples/include-external-npm-packages/webpack.config.js index 3eeb2ac..846684e 100644 --- a/examples/include-external-npm-packages/webpack.config.js +++ b/examples/include-external-npm-packages/webpack.config.js @@ -3,5 +3,5 @@ var path = require('path'); module.exports = { entry: './handler.js', target: 'node', - externals: ["fbgraph", "aws-sdk"] // packages to be excluded from bundled file + externals: ["fbgraph", "aws-sdk"] // modules to be excluded from bundled file }; diff --git a/lib/packExternalModules.js b/lib/packExternalModules.js index 1e2f9aa..0e8e9c0 100644 --- a/lib/packExternalModules.js +++ b/lib/packExternalModules.js @@ -10,7 +10,7 @@ module.exports = { const includes = ( this.serverless.service.custom && - this.serverless.service.custom.includePackages + this.serverless.service.custom.webpackIncludeModules ); return BbPromise.resolve().then(() => {