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:
@@ -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,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user