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
After installing this npm package, add the [config plugin](https://docs.expo.io/guides/config-plugins/) to the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your `app.json` or `app.config.js`:
49
+
50
+
```json
51
+
{
52
+
"expo": {
53
+
"plugins": ["react-native-vector-image"]
54
+
}
55
+
}
56
+
```
57
+
58
+
Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide.
59
+
60
+
#### Options
61
+
62
+
```json
63
+
{
64
+
"expo": {
65
+
"plugins": [
66
+
[
67
+
"react-native-vector-image",
68
+
{
69
+
// These are default options, change if you want a different value:
70
+
"stripSvgs": false, // if true, svgs will be removed from bundle. expo-updates package crashes when svgs it expects in the bundle are not there
71
+
"metroConfigFile": "metro.config.js",
72
+
"resetCache": false,
73
+
"bundleWithExpo": true,
74
+
"entryFile": "index.ts"
75
+
}
76
+
]
77
+
]
78
+
}
79
+
}
80
+
```
81
+
82
+
Shout out to [zamplyy](https://github.com/zamplyy) for making the first version of the Expo plugin.
83
+
47
84
## Usage
48
85
49
86
Since native vector assets cannot be served over http via metro dev server, they must be generated and compiled into the app bundle.
@@ -62,21 +99,24 @@ To add dark mode to your image, create a new file with an `.dark.svg` extension,
62
99
63
100
This takes a while as metro has to go through all the code to find the imported SVGs.
64
101
102
+
_Note: for Expo just use the plugin and `npx expo prebuild`._
0 commit comments