diff options
author | silverwind <me@silverwind.io> | 2023-09-01 16:07:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-01 14:07:37 +0000 |
commit | 327a7ad5185ea532389ff54b5faf91a8cf0429f3 (patch) | |
tree | 2b97a1b9f6b23fe83c3d4258ec5a7d2ae2ad4cd4 /webpack.config.js | |
parent | 4ab8e56c9197135a85300542d736a556203752a6 (diff) | |
download | gitea-327a7ad5185ea532389ff54b5faf91a8cf0429f3.tar.gz gitea-327a7ad5185ea532389ff54b5faf91a8cf0429f3.zip |
Use case-insensitive regex for all webpack assets (#26867)
Previously, only some of these regex had the `i` flag and while we can
likely ensure case for our files, these regexes are also used for
third-party files, so it's better to always match insensitively.
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/webpack.config.js b/webpack.config.js index 9574961116..497aca9224 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -41,10 +41,10 @@ const filterCssImport = (url, ...args) => { if (cssFile.includes('fomantic')) { if (/brand-icons/.test(importedFile)) return false; - if (/(eot|ttf|otf|woff|svg)$/.test(importedFile)) return false; + if (/(eot|ttf|otf|woff|svg)$/i.test(importedFile)) return false; } - if (cssFile.includes('katex') && /(ttf|woff)$/.test(importedFile)) { + if (cssFile.includes('katex') && /(ttf|woff)$/i.test(importedFile)) { return false; } @@ -117,12 +117,12 @@ export default { module: { rules: [ { - test: /\.vue$/, + test: /\.vue$/i, exclude: /node_modules/, loader: 'vue-loader', }, { - test: /\.js$/, + test: /\.js$/i, exclude: /node_modules/, use: [ { @@ -151,12 +151,12 @@ export default { ], }, { - test: /\.svg$/, + test: /\.svg$/i, include: fileURLToPath(new URL('public/assets/img/svg', import.meta.url)), type: 'asset/source', }, { - test: /\.(ttf|woff2?)$/, + test: /\.(ttf|woff2?)$/i, type: 'asset/resource', generator: { filename: 'fonts/[name].[contenthash:8][ext]', |