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

fix mod serialization #3008

Merged
merged 1 commit into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
};