forked from forgejo/forgejo
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:
parent
cce006b857
commit
d099f0858f
3 changed files with 14 additions and 56 deletions
|
@ -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
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue