diff --git a/webpack.config.js b/webpack.config.js index 357f0e6f5d1..56cde9646a9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -807,7 +807,7 @@ function getAssetOutputPath(url, resourcePath) { const isKaTeX = resourcePath.includes("KaTeX"); // `res` is the parent dir for our own assets in various layers // `dist` is the parent dir for KaTeX assets - const prefix = /^.*[/\\](dist|res)[/\\]/; + const prefix = /^.*[/\\](dist|res|compound-design-tokens)[/\\]/; /** * Only needed for https://github.com/vector-im/element-web/pull/15939 @@ -819,20 +819,6 @@ function getAssetOutputPath(url, resourcePath) { } let outputDir = path.dirname(resourcePath).replace(prefix, ""); - /** - * Imports from Compound are "absolute", we need to strip out the prefix - * coming before the npm package name. - * - * This logic is scoped to compound packages for now as they are the only - * package that imports external assets. This might need to be made more - * generic in the future - */ - const compoundImportsPrefix = /@vector-im(?:\\|\/)compound-(.*?)(?:\\|\/)/; - const compoundMatch = outputDir.match(compoundImportsPrefix); - if (compoundMatch) { - outputDir = outputDir.substring(compoundMatch.index + compoundMatch[0].length); - } - if (isKaTeX) { // Add a clearly named directory segment, rather than leaving the KaTeX // assets loose in each asset type directory.