Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
fix mod serialization (#3008)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon authored Dec 9, 2020
1 parent 82e2393 commit 54b9d4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/config/src/Serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export function serializeAfterStaticPlugins(val: any): any {
const output: { [key: string]: any } = {};
for (const property in val) {
if (val.hasOwnProperty(property)) {
if (property === 'plugins' && Array.isArray(val[property])) {
if (property === 'mods') {
// Don't serialize mods
output[property] = val[property];
} else if (property === 'plugins' && Array.isArray(val[property])) {
// Serialize the mods by removing any config plugins
output[property] = val[property].map(serializeAndEvaluatePlugin);
} else {
Expand Down
5 changes: 4 additions & 1 deletion packages/config/src/__tests__/fixtures/plugins/my-plugin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const { withAndroidManifest } = require('@expo/config-plugins');

module.exports = config => {
config.slug = 'from-custom-plugin';
return config;
// test that the mods don't get serialized
return withAndroidManifest(config, config => config);
};

0 comments on commit 54b9d4f

Please sign in to comment.