mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
Remove file-loader dependency (#15196)
- Upgrade webpack to 5.28 to enable publicPath option - Use asset modules in place of deprecated file-loader Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
@ -211,29 +211,19 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|woff2?)$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
outputPath: 'fonts/',
|
||||
publicPath: (url) => `../fonts/${url}`, // required to remove css/ path segment
|
||||
},
|
||||
},
|
||||
],
|
||||
type: 'asset/resource',
|
||||
generator: {
|
||||
filename: 'fonts/[name][ext]',
|
||||
publicPath: '/', // required to remove css/ path segment
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.png$/i,
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
outputPath: 'img/webpack/',
|
||||
publicPath: (url) => `../img/webpack/${url}`, // required to remove css/ path segment
|
||||
},
|
||||
},
|
||||
],
|
||||
type: 'asset/resource',
|
||||
generator: {
|
||||
filename: 'img/webpack/[name][ext]',
|
||||
publicPath: '/', // required to remove css/ path segment
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
|
Reference in New Issue
Block a user