chore: 🤖 Add patch-package to fix ember-intl for windows builds (#1742)

✅ Closes: ICU-9914
This commit is contained in:
Zhihe Li authored and GitHub committed 2023-06-23 14:35:18 -04:00
1 parent 4334d51da3
commit cd557a86cc
3 files changed
+71 -3

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
diff --git a/node_modules/ember-intl/lib/broccoli/translation-reducer/utils/wrap-with-namespace-if-needed.js b/node_modules/ember-intl/lib/broccoli/translation-reducer/utils/wrap-with-namespace-if-needed.js
index 3782ed5..37506d4 100644
--- a/node_modules/ember-intl/lib/broccoli/translation-reducer/utils/wrap-with-namespace-if-needed.js
+++ b/node_modules/ember-intl/lib/broccoli/translation-reducer/utils/wrap-with-namespace-if-needed.js
@@ -16,12 +16,16 @@ const enums = require('../../enums');
* @private
*/
function wrapWithNamespaceIfNeeded(object, filepath, inputPath, addonNames) {
- let dirname = path.dirname(filepath).replace(inputPath, '');
+ const normalizedFilePath = path.normalize(filepath);
+ const normalizedInputPath = path.normalize(inputPath);
+ const normalizedAddonNames = addonNames.map(path.normalize);
+
+ let dirname = path.dirname(normalizedFilePath).replace(normalizedInputPath, '');
if (dirname) {
let prefix = path.sep;
- for (let addon of addonNames) {
+ for (let addon of normalizedAddonNames) {
let addonPrefix = `${path.sep}${enums.addonNamespace}${path.sep}${addon}`;
if (dirname.startsWith(addonPrefix)) {