You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-7Lines changed: 21 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,9 @@ Serverless Browserifier Plugin
7
7
[![NPM downloads][downloads-badge]][npm-url]
8
8
[![standardjs][standardjs-badge]][standardjs-url]
9
9
10
-
> A [Serverless](https://serverless.com) v1 plugin that uses [`browserify`][browserify-url] to bundle your Node.js Lambda functions.
10
+
> A [Serverless](https://serverless.com) v1 and v2 plugin that uses [`browserify`][browserify-url] to bundle your Node.js Lambda functions.
11
11
12
+
1.[Supported Commands](#supported-commands)
12
13
1.[Motivation](#motivation)
13
14
1.[Installation](#installation)
14
15
1.[Basic Setup](#basic-setup)
@@ -18,6 +19,16 @@ Serverless Browserifier Plugin
18
19
1.[License](#license)
19
20
20
21
22
+
Supported Commands
23
+
------------------
24
+
25
+
-`serverless package`
26
+
-`serverless deploy`
27
+
-`serverless deploy function`
28
+
-`serverless invoke local`
29
+
+ the plugin will automatically build and use your bundle to execute the function locally; to avoid it, you can use the `--no-build` option, which will then use your handler file directly
30
+
31
+
21
32
Motivation
22
33
----------
23
34
@@ -80,14 +91,17 @@ The base config can be overridden on a function-by-function basis. Again, `cust
80
91
custom:
81
92
browserify:
82
93
# any option defined in https://github.com/substack/node-browserify#browserifyfiles--opts
94
+
extensions:
95
+
- .js # default
83
96
84
97
functions:
85
98
usersGet:
86
99
description: Get users
87
100
handler: users/index.handler
88
101
browserify:
102
+
# any option defined in https://github.com/substack/node-browserify#browserifyfiles--opts
89
103
noParse:
90
-
- ./someBig.json #browserify can't optimize json, will take long time to parse for nothing
104
+
- ./someBig.json #browserify can't optimize json, will take long time to parse for nothing
91
105
```
92
106
93
107
If you find a package that is not supported or does not behave well with browserify, you can still use function level `package.include` to include extra modules and files to your package. That said, you are encouraged to verify if you specific case can be dealt with by leveraging all available [browserify options][browserify-options] in your `serverless.yml` custom `browserify` section.
@@ -120,7 +134,7 @@ When this plugin is enabled, and `package.individually` is `true`, running `serv
120
134
If you want to see more information about the process, simply set envvar `SLS_DEBUG=*` for full serverless debug output, or `SLS_BROWSERIFIER_DEBUG=*` for plugin only debug messages. Example:
Although you can use discrete clients (see item above), AWS Lambda service always bundles up the latest SDK version in its Lambda container image. That means that, even if you don't add AWS SDK to your bundle, it will still be available in runtime.
180
194
@@ -194,7 +208,7 @@ To help you out, here's a script you can use to hide `aws-sdk` and all its clien
@@ -230,9 +244,9 @@ __What about uglification? And babel?__
230
244
231
245
You should be able to use [`uglify-es`][uglify-url] through [`uglifyify`][uglifyify-url]. For babel usage, [`babelify`][babelify-url] should do the trick. Refer back to [_Using browserify plugins_](#using-browserify-pluginstransforms) section to set it up.
232
246
233
-
__Avoid mixing this plugin with other plugins that modify serverless' packaging behaviour!__
247
+
__This other plugin I use is not playing ball with `serverless-plugin-browserifier`! What's up?__
234
248
235
-
This plugin _hijacks_ the normal serverless packaging process, so it will probably conflict with other plugins that use similar mechanisms.
249
+
This plugin _hijacks_ the normal serverless packaging process, so it will probably conflict with other plugins that use similar mechanisms. Please avoid mixing this plugin with other plugins that modify serverless' packaging behaviour.
0 commit comments