mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Merge pull request #1708 from mchangrh/windows-webpack
fix paths for windows dev
This commit is contained in:
commit
3dcc4240dc
1 changed files with 3 additions and 3 deletions
|
@ -117,7 +117,7 @@ module.exports = env => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /js\/document\.js$/,
|
test: /js(\/|\\)document\.js$/,
|
||||||
type: 'asset/source'
|
type: 'asset/source'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -141,7 +141,7 @@ module.exports = env => {
|
||||||
},
|
},
|
||||||
context: './public',
|
context: './public',
|
||||||
filter: async (path) => {
|
filter: async (path) => {
|
||||||
if (path.match(/\/_locales\/.+/)) {
|
if (path.match(/(\/|\\)_locales(\/|\\).+/)) {
|
||||||
if (env.browser.toLowerCase() === "edge"
|
if (env.browser.toLowerCase() === "edge"
|
||||||
&& !edgeLanguages.includes(path.match(/(?<=\/_locales\/)[^/]+(?=\/[^/]+$)/)[0])) {
|
&& !edgeLanguages.includes(path.match(/(?<=\/_locales\/)[^/]+(?=\/[^/]+$)/)[0])) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -156,7 +156,7 @@ module.exports = env => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
transform(content, path) {
|
transform(content, path) {
|
||||||
if (path.match(/\/_locales\/.+/)) {
|
if (path.match(/(\/|\\)_locales(\/|\\).+/)) {
|
||||||
const parsed = JSON.parse(content.toString());
|
const parsed = JSON.parse(content.toString());
|
||||||
if (env.browser.toLowerCase() === "safari") {
|
if (env.browser.toLowerCase() === "safari") {
|
||||||
parsed.fullName.message = parsed.fullName.message.match(/^.+(?= -)/)?.[0] || parsed.fullName.message;
|
parsed.fullName.message = parsed.fullName.message.match(/^.+(?= -)/)?.[0] || parsed.fullName.message;
|
||||||
|
|
Loading…
Reference in a new issue