Webpack-multipage (multiple entry points) starter template for creating a multipage static html website.
- Create a folder in the src directory with the name
page-<name>
and its respective<name>.js
,<name>.css
and<name>.html
files. Make sure that you use the same<name>
in all those three places. - Go to
bundler/webpack.common.config.js
and add the<name>
as a string to thehtmlPageNames
array. - Re-run the dev server using:
npm run dev
. - Check out that entry point using
<local Hosting Address>/<name>.html
- Delete the respective folder
- Remove that
<name>
from thehtmlPagesArray
. - Re-run the server -
npm run dev
. - That entry point should no longer be accessible.
Inspired By - https://github.com/ivarprudnikov/webpack-static-html-pages:
- Splitchunks for common node_modules.
- An easy function that loops through the
htmlPageNames
array to create HTMl pages easily.