Skip to content

Commit

Permalink
chore: remove deprecated file-loader from examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Feb 19, 2021
1 parent 73d2a66 commit 1f7ce7e
Show file tree
Hide file tree
Showing 22 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/chunk-optimization/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' }
{ test: /\.png$/, type: 'asset/resource' }
]
},
optimization: {
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-template/dist/webpack-5/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body><h2>Partial</h2><img src="55b19870aff2e53d1fb1a258c1032fbf.png"></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body><h2>Partial</h2><img src="55b19870aff2e53d1fb1.png"></body></html>
2 changes: 1 addition & 1 deletion examples/custom-template/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# custom template

This example uses a custom underscore template which inlines an partial using the html-loader:
`<%= require('html-loader!./partial.html') %>`
`<%= require('html-loader!./partial.html').default %>`
2 changes: 1 addition & 1 deletion examples/custom-template/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' }
{ test: /\.png$/, type: 'asset/resource' }
]
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/default/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' }
{ test: /\.png$/, type: 'asset/resource' }
]
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/favicon/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' }
{ test: /\.png$/, type: 'asset/resource' }
]
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/html-loader/dist/webpack-5/about.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body><img src="55b19870aff2e53d1fb1a258c1032fbf.png"></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body><img src="55b19870aff2e53d1fb1.png"></body></html>
2 changes: 1 addition & 1 deletion examples/html-loader/dist/webpack-5/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body><img src="55b19870aff2e53d1fb1a258c1032fbf.png"></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body><img src="55b19870aff2e53d1fb1.png"></body></html>
2 changes: 1 addition & 1 deletion examples/html-loader/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' },
{ test: /\.png$/, type: 'asset/resource' },
{ test: /\.html$/, loader: 'html-loader' }
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/javascript-advanced/dist/webpack-5/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<html><head><title>Webpack App</title><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body>Hello World from backend -<h2>Partial</h2><img src="55b19870aff2e53d1fb1a258c1032fbf.png"></body></html>
<html><head><title>Webpack App</title><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body>Hello World from backend -<h2>Partial</h2><img src="55b19870aff2e53d1fb1.png"></body></html>
2 changes: 1 addition & 1 deletion examples/javascript-advanced/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' },
{ test: /\.png$/, type: 'asset/resource' },
{ test: /\.html$/, loader: 'html-loader' }
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/javascript/dist/webpack-5/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<head><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head>Hello World from backend2021-02-19T12:55:16.489Z<h2>Partial</h2><img src="55b19870aff2e53d1fb1.png">
<head><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head>Hello World from backend2021-02-19T13:58:22.479Z<h2>Partial</h2><img src="55b19870aff2e53d1fb1.png">
2 changes: 1 addition & 1 deletion examples/multi-page/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' }
{ test: /\.png$/, type: 'asset/resource' }
]
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/pug-loader/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' },
{ test: /\.png$/, type: 'asset/resource' },
{ test: /\.pug$/, loader: 'pug-loader' }
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/sort-manually/dist/webpack-5/first-file.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="a.js"></script><script defer="defer" src="b.js"></script><script defer="defer" src="c.js"></script><link href="styles.css" rel="stylesheet"></head><body><img src="55b19870aff2e53d1fb1a258c1032fbf.png"></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="a.js"></script><script defer="defer" src="b.js"></script><script defer="defer" src="c.js"></script><link href="styles.css" rel="stylesheet"></head><body><img src="55b19870aff2e53d1fb1.png"></body></html>
2 changes: 1 addition & 1 deletion examples/sort-manually/dist/webpack-5/second-file.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="a.js"></script><script defer="defer" src="b.js"></script><script defer="defer" src="d.js"></script><link href="styles.css" rel="stylesheet"></head><body><img src="55b19870aff2e53d1fb1a258c1032fbf.png"></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="a.js"></script><script defer="defer" src="b.js"></script><script defer="defer" src="d.js"></script><link href="styles.css" rel="stylesheet"></head><body><img src="55b19870aff2e53d1fb1.png"></body></html>
2 changes: 1 addition & 1 deletion examples/sort-manually/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' },
{ test: /\.png$/, type: 'asset/resource' },
{ test: /\.html$/, loader: 'html-loader' }
]
},
Expand Down
2 changes: 1 addition & 1 deletion migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ For the above example you would have to configure a [html](https://github.com/we
```js
module: {
rules: [
{test: /\.png$/, loader: "file-loader"},
{ test: /\.png$/, type: 'asset/resource' },
{
test: /\.html$/,
exclude: /index\.html$/, // you need to exclude your base template (unless you do not want this plugin own templating feature)
Expand Down

0 comments on commit 1f7ce7e

Please sign in to comment.