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/**",
|
||||
to({ context, absoluteFilename }) {
|
||||
const appName = /app-store\/(.*)\/static/.exec(absoluteFilename);
|
||||
return Promise.resolve(`${context}/public/app-store/${appName[1]}/[name][ext]`);
|
||||
// Adds compatibility for windows path
|
||||
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