From 0e178ce1bc162fa9d07bc9f8692db8fd126fe196 Mon Sep 17 00:00:00 2001 From: Yura Bondarenko Date: Thu, 3 Mar 2022 18:11:52 +0100 Subject: [PATCH] 87968: Fix missing theme assets Adapt to changes in https://github.com/webpack-contrib/copy-webpack-plugin --- webpack/webpack.common.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/webpack/webpack.common.ts b/webpack/webpack.common.ts index 8c2c11f660..219ee1bcbb 100644 --- a/webpack/webpack.common.ts +++ b/webpack/webpack.common.ts @@ -19,11 +19,10 @@ export const copyWebpackOptions = { // replace(/\\/g, '/') because glob patterns need forward slashes, even on windows: // https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows from: path.join(__dirname, '..', 'src', 'themes', '*', 'assets', '**', '*').replace(/\\/g, '/'), - to: 'assets', noErrorOnMissing: true, - transformPath(targetPath, absolutePath) { + to({ absoluteFilename }) { // use [\/|\\] to match both POSIX and Windows separators - const matches = absolutePath.match(/.*[\/|\\]themes[\/|\\]([^\/|^\\]+)[\/|\\]assets[\/|\\](.+)$/); + const matches = absoluteFilename.match(/.*[\/|\\]themes[\/|\\]([^\/|^\\]+)[\/|\\]assets[\/|\\](.+)$/); if (matches) { // matches[1] is the theme name // matches[2] is the rest of the path relative to the assets folder