Skip to content

Commit 2f86a09

Browse files
author
Frank Schmid
committed
Added documentation
1 parent 587ef91 commit 2f86a09

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ custom:
192192
```
193193
> Note that only relative path is supported at the moment.
194194

195+
#### Forced inclusion
195196

196197
Sometimes it might happen that you use dynamic requires in your code, i.e. you
197198
require modules that are only known at runtime. Webpack is not able to detect
@@ -209,6 +210,26 @@ custom:
209210
- module2
210211
```
211212

213+
#### Forced exclusion
214+
215+
You can forcefully exclude detected external modules, e.g. if you have a module
216+
in your dependencies that is already installed at your provider's environment.
217+
218+
Just add them to the `forceExclude` array property and they will not be packaged.
219+
220+
```yaml
221+
# serverless.yml
222+
custom:
223+
webpackIncludeModules:
224+
forceExclude:
225+
- module1
226+
- module2
227+
```
228+
229+
If you specify a module in both arrays, `forceInclude` and `forceExclude`, the
230+
exclude wins and the module will not be packaged.
231+
232+
#### Examples
212233

213234
You can find an example setups in the [`examples`][link-examples] folder.
214235

0 commit comments

Comments
 (0)