Adds windows compatibility for copywebpackplugin (#5602)
* adds windows compatibility * Revert unintentional changepull/5614/head
parent
91274d8ee0
commit
196549c124
|
@ -99,8 +99,14 @@ const nextConfig = {
|
||||||
{
|
{
|
||||||
from: "../../packages/app-store/**/static/**",
|
from: "../../packages/app-store/**/static/**",
|
||||||
to({ context, absoluteFilename }) {
|
to({ context, absoluteFilename }) {
|
||||||
const appName = /app-store\/(.*)\/static/.exec(absoluteFilename);
|
// Adds compatibility for windows path
|
||||||
return Promise.resolve(`${context}/public/app-store/${appName[1]}/[name][ext]`);
|
const absoluteFilenameWin = absoluteFilename.replaceAll("\\", "/");
|
||||||
|
// Adds compatibility for windows path
|
||||||
|
const normalizedContext = context.replaceAll("\\", "/");
|
||||||
|
const appName =
|
||||||
|
/app-store\/(.*)\/static/.exec(absoluteFilename) ||
|
||||||
|
/app-store\/(.*)\/static/.exec(absoluteFilenameWin);
|
||||||
|
return Promise.resolve(`${normalizedContext}/public/app-store/${appName[1]}/[name][ext]`);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue