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: docs/Configuration.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,11 @@ The bundle configuration consist of the following properties:
106
106
- `dependsOn?: string[]` (_optional_, **multi-bundle mode only**) - Specify on which DLLs the bundle depends on, which will be automatically linked when building the bundle.
107
107
- `providesModuleNodeModules?: Array<string | { name: string; directory: string }>` - Provide custom modules for Haste.
Copy file name to clipboardExpand all lines: docs/Recipes.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,6 +215,40 @@ Set the environment variable `APP_ENV` to `detox_tests` when running Haul:
215
215
APP_ENV=detox_tests yarn haul
216
216
```
217
217
218
+
## Using with Lottie or loose-mode-only-compatible libraries
219
+
220
+
Some React Native libraries might not work with Haul out of the box. If the library if throw error, it is possible that it's not compatible with strict mode checks.
221
+
222
+
By default all modules with Haul have `'use strict';` annotation, which makes the code evaluated in strict mode, whereas the default React Native bundler - Metro - generates the code without this annotation. For that reason, some libraries eg `Lottie` need special steps to work.
223
+
224
+
To enable loose mode, you need to add `looseMode` property to your config set to:
225
+
226
+
-`true` - removes all `'use strict';` from the whole bundle
227
+
- array for absolute filenames of modules - matched modules will have `'use strict';` removed
228
+
- array of regexes - matched modules will have `'use strict';` removed
229
+
- function that accepts absolute module filename and must return `true` to remove `'use strict';` or `false`
0 commit comments