File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,7 @@ custom:
192
192
` ` `
193
193
> Note that only relative path is supported at the moment.
194
194
195
+ # ### Forced inclusion
195
196
196
197
Sometimes it might happen that you use dynamic requires in your code, i.e. you
197
198
require modules that are only known at runtime. Webpack is not able to detect
@@ -209,6 +210,26 @@ custom:
209
210
- module2
210
211
` ` `
211
212
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
212
233
213
234
You can find an example setups in the [`examples`][link-examples] folder.
214
235
You can’t perform that action at this time.
0 commit comments