Replace override raw-loader with ?raw query (#33854)

* Replace override raw-loader with `?raw` query

For compatibility with vite/st

* Make knip happy

* Fix icon in Jitsi lobby

* Fix jest config for `?raw`

* Remove stale `$webapp` alias

* Ensure css files loaded as `?raw` do not get bundled
This commit is contained in:
Michael Telatynski
2026-06-18 09:36:07 +00:00
committed by GitHub
parent 7a1a3f518c
commit 7bb842e8d4
9 changed files with 13 additions and 32 deletions
+7 -3
View File
@@ -254,9 +254,6 @@ export default (env: string, argv: Record<string, any>): webpack.Configuration =
"matrix-widget-api": getPackageRoot("matrix-widget-api"),
"oidc-client-ts": getPackageRoot("oidc-client-ts"),
// Define a variable so the i18n stuff can load
"$webapp": path.resolve(__dirname, "webapp"),
// Make shared-components imports resolve to EW deps
"@vector-im/compound-web": getPackageRoot("@vector-im/compound-web", ""),
},
@@ -300,6 +297,12 @@ export default (env: string, argv: Record<string, any>): webpack.Configuration =
/highlight\.js[\\/]lib[\\/]languages/,
],
rules: [
{
// Match imports containing the ?raw query string
resourceQuery: /raw/,
// Instruct Webpack to emit the file source as a string
type: "asset/source",
},
{
test: /\.js$/,
enforce: "pre" as const,
@@ -337,6 +340,7 @@ export default (env: string, argv: Record<string, any>): webpack.Configuration =
},
{
test: /\.css$/,
resourceQuery: { not: [/raw/] },
use: [
MiniCssExtractPlugin.loader,
{