Skip to content

Commit

Permalink
Remove file-loader (#107)
Browse files Browse the repository at this point in the history
* Remove file-loader
`file-loader` is deprecated in Webpack 5, replaced by [asset modules](https://webpack.js.org/guides/asset-modules/).

* npm run build

* npm run build
  • Loading branch information
eatyourgreens authored Feb 13, 2023
1 parent 41a4a5d commit b423075
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/main.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions app/main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ and limitations under the License.

/*! https://mths.be/punycode v1.3.2 by @mathias */

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/** @license React v0.20.2
* scheduler.production.min.js
*
Expand Down
4 changes: 1 addition & 3 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@babel/preset-react": "^7.18.6",
"babel-loader": "^9.1.2",
"css-loader": "^6.7.3",
"file-loader": "^6.2.0",
"sass": "^1.58.0",
"sass-loader": "^13.2.0",
"style-loader": "^3.3.1",
Expand Down
38 changes: 12 additions & 26 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,38 +56,24 @@ module.exports = {
},
{ // Copy HTML file
test: /\.html$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
}
},
],
type: 'asset/resource',
generator: {
filename: '[name][ext]'
}
},
{ // Copy media assets
test: /\.(png|jpe?g|gif)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'assets',
},
},
],
type: 'asset/resource',
generator: {
filename: 'assets/[name][ext]'
}
},
{ // Copy demo data
test: /demo-data\/.+\.txt/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'demo-data',
},
},
],
type: 'asset/resource',
generator: {
filename: 'demo-data/[name][ext]'
}
},
],
},
Expand Down

0 comments on commit b423075

Please sign in to comment.