Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove file-loader dependency
- Upgrade webpack to 5.28 to enable publicPath option
- Use asset modules in place of deprecated file-loader
  • Loading branch information
silverwind committed Mar 29, 2021
commit d6fc45a5f2a84baaaa19ea81df7a2094c2db4f87
37 changes: 3 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"easymde": "2.14.0",
"escape-goat": "3.0.0",
"fast-glob": "3.2.5",
"file-loader": "6.2.0",
"font-awesome": "4.7.0",
"jquery": "3.6.0",
"jquery.are-you-sure": "1.9.0",
Expand All @@ -44,7 +43,7 @@
"vue-calendar-heatmap": "0.8.4",
"vue-loader": "15.9.6",
"vue-template-compiler": "2.6.12",
"webpack": "5.27.1",
"webpack": "5.28.0",
"webpack-cli": "4.5.0",
"workbox-routing": "6.1.2",
"workbox-strategies": "6.1.2",
Expand Down
30 changes: 10 additions & 20 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
],
},
Expand Down