[i18n] exclude target and vendor when extracting files (#57978) (#58332)

* exclude target and vendor

* update snapshots
This commit is contained in:
Ahmad Bamieh 2020-02-24 16:53:03 +02:00 committed by GitHub
parent 189909a195
commit caee69a3aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View file

@ -64,7 +64,8 @@ Array [
\\"plugin-1.message-id-1\\": \\"Translated text 1\\",
\\"plugin-1.message-id-2\\": \\"Translated text 2\\"
}
}",
}
",
]
`;
@ -131,7 +132,8 @@ Array [
\\"messages\\": {
\\"plugin-2.message-id\\": \\"Translated text\\"
}
}",
}
",
]
`;

View file

@ -63,6 +63,9 @@ export async function matchEntriesWithExctractors(inputPath, options = {}) {
const ignore = [
'**/node_modules/**',
'**/__tests__/**',
'**/dist/**',
'**/target/**',
'**/vendor/**',
'**/*.test.{js,jsx,ts,tsx}',
'**/*.d.ts',
].concat(additionalIgnore);

View file

@ -85,5 +85,6 @@ exports[`dev/i18n/serializers/json should serialize default messages to JSON 1`]
\\"comment\\": \\"Message description\\"
}
}
}"
}
"
`;

View file

@ -34,5 +34,5 @@ export const serializeToJson: Serializer = (messages, formats = i18n.formats) =>
}
}
return JSON.stringify(resultJsonObject, undefined, 2);
return JSON.stringify(resultJsonObject, undefined, 2).concat('\n');
};