My bundle on Webpack 5 (Typescript, SCSS, html modules, webp/avif transforming & checking, font plugging in, spritemap...)
- Register html pages for your project in the "config/pages.ts":
- Add names for pages.
- Add js chunck names if the page will use them.
- Add html pages, that you have registered, in "src/html/pages/".
- Add modules html files in "src/html/modules" (there`s no need to register them).
- Use modules html by printing
<%=_.template(require('raw-loader!@/html/modules/header.html').default)()%>in the html pages (as an example).
- Transform your png/jpg/jpeg images in webp and avif. Just upload images in the
src/assets/imgfolder.- Typescrpt code in
src/ts/functions/functions.tsis checking if the browser supports webp and avif images. If it does,htmltag will have class 'webp' or/and 'avif', if it doesn`t support them,htmltag will have class 'no-webp' or/and 'no-avif'.
- Typescrpt code in
- Automatically plug in your fonts in
_fonts.scssfile. There is no need to create it, just upload your fonts in thesrc/assets/fontsfolder. - Automatically create a spritemap file from your sprites. Just upload your sprites in the
src/assets/spritesfolder.