-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added webpack-pages config to automate HtmlWebpackPlugin
- Loading branch information
Showing
7 changed files
with
222 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<title>Webpack Template</title> | ||
</head> | ||
<body> | ||
<div style="padding: 2rem; max-width: 720px; margin: 0 auto"> | ||
<img src="/static/img/webpack.svg" style="width: 100%; max-width: 400px; height: auto" /> | ||
<div style="font-size: 1.75rem">It works!</div> | ||
|
||
<!-- pages list --> | ||
<!-- based on `webpack-pages.js` --> | ||
<ul style="padding: 1rem"> | ||
<li style="padding-bottom: 0.5rem"> | ||
<a href="/" style="color: blue">Home page</a> | ||
</li> | ||
<li style="padding-bottom: 0.5rem"> | ||
<a href="/about" style="color: blue">About page (active)</a> | ||
</li> | ||
<li style="padding-bottom: 0.5rem"> | ||
<a href="https://github.com/vedees/webpack-template/blob/webpack5/README.md" target="_blank" style="color: blue">Documentation</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// automation for `HtmlWebpackPlugin` | ||
|
||
// Notes: | ||
// - remember to restart server after new page added | ||
// - link on the html must be with .html suffix (i.g. <a href="/about.html">About</a>) | ||
|
||
const pages = [ | ||
{ | ||
// page title | ||
title: 'Home page', | ||
// template name `public/index.html` | ||
template: 'index.html', | ||
// output filename `dist/index.html` | ||
filename: 'index.html' | ||
|
||
// you can pass a hash of configuration options to html-webpack-plugin. | ||
// Allowed values are as follows: | ||
// read more: https://github.com/jantimon/html-webpack-plugin#options | ||
}, | ||
{ | ||
title: 'About page', | ||
template: 'about.html', | ||
filename: 'about.html' | ||
} | ||
] | ||
|
||
module.exports = pages |
Oops, something went wrong.