fix paths for windows dev

This commit is contained in:
Michael C 2023-03-24 17:40:29 -04:00
parent 5711e70dbb
commit 4db3343029
No known key found for this signature in database
GPG key ID: FFB04FB3B878B7B4

View file

@ -117,7 +117,7 @@ module.exports = env => {
}
},
{
test: /js\/document\.js$/,
test: /js(\/|\\)document\.js$/,
type: 'asset/source'
}
]
@ -141,7 +141,7 @@ module.exports = env => {
},
context: './public',
filter: async (path) => {
if (path.match(/\/_locales\/.+/)) {
if (path.match(/(\/|\\)_locales(\/|\\).+/)) {
if (env.browser.toLowerCase() === "edge"
&& !edgeLanguages.includes(path.match(/(?<=\/_locales\/)[^/]+(?=\/[^/]+$)/)[0])) {
return false;
@ -156,7 +156,7 @@ module.exports = env => {
}
},
transform(content, path) {
if (path.match(/\/_locales\/.+/)) {
if (path.match(/(\/|\\)_locales(\/|\\).+/)) {
const parsed = JSON.parse(content.toString());
if (env.browser.toLowerCase() === "safari") {
parsed.fullName.message = parsed.fullName.message.match(/^.+(?= -)/)?.[0] || parsed.fullName.message;