Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support forceExclude to exclude dependencies #248

Merged
merged 3 commits into from
Oct 19, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added documentation
  • Loading branch information
Frank Schmid committed Oct 11, 2017
commit f52ebc200996e8840a8ae07955e8b3a595646905
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -192,6 +192,7 @@ custom:
```
> Note that only relative path is supported at the moment.

#### Forced inclusion

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

#### Forced exclusion

You can forcefully exclude detected external modules, e.g. if you have a module
in your dependencies that is already installed at your provider's environment.

Just add them to the `forceExclude` array property and they will not be packaged.

```yaml
# serverless.yml
custom:
webpackIncludeModules:
forceExclude:
- module1
- module2
```

If you specify a module in both arrays, `forceInclude` and `forceExclude`, the
exclude wins and the module will not be packaged.

#### Examples

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