OK! I got it. Couldn’t figure out how to make it work as a typescript file with es6 import/export but this is where I ended up.
- Add
config_plugins
folder at the top level of the app. - Add a
withAnimatedWebp.js
file into the folder. - Add
"plugins": ["./config_plugins/withAnimatedWebp"],
toapp.json
.
// withAnimatedWebp.js
const { createRunOncePlugin, withGradleProperties } = require('@expo/config-plugins');
const withAnimatedWebp = (config) => {
const itemToModify = {
type: 'property',
key: 'expo.webp.animated',
value: 'true',
};
return withGradleProperties(config, (config) => {
config.modResults = config.modResults.filter(
(item) => !(item.type === itemToModify.type && item.key === itemToModify.key)
);
config.modResults.push(itemToModify);
return config;
});
};
module.exports = createRunOncePlugin(withAnimatedWebp, 'animated-webp-support', '1.0.0');
Now onto the real bug challenges. Thanks @wodin!