webpack-es6-sass-boilerplate icon indicating copy to clipboard operation
webpack-es6-sass-boilerplate copied to clipboard

Don't understand how to add multiples pages

Open maximeRoudier opened this issue 4 years ago • 4 comments

Hi vadimmarkov, Your tool is good but I don't understand how to add multiples pages html. I have index-en.html / index-fr.html / index-it.html / index-es.html and those pages aren't builded. So I tried to do this, in webpack.production.js :

const production = { plugins: [ new HtmlWebpackPlugin({ template: 'index-en.html', filename: './index-en.html', chunks: ['index-en'], minify: { removeComments: true, collapseWhitespace: true, removeRedundantAttributes: true, useShortDoctype: true, removeEmptyAttributes: true, removeStyleLinkTypeAttributes: true, keepClosingSlash: true, } }), new HtmlWebpackPlugin({ template: 'index-fr.html', filename: './index-fr.html', chunks: ['index-fr'], }), new HtmlWebpackPlugin({ template: 'index-es.html', filename: './index-es.html', chunks: ['index-es'], }), new HtmlWebpackPlugin({ template: 'index-it.html', filename: './index-it.html', chunks: ['index-it'], }), new StatsWriterPlugin({ fields: null, filename: '../stats.json' }), new WebpackAssetsManifest(), new CssoWebpackPlugin(), ], devtool: 'source-map', };

It works, I get my pages builded but my css/js is broken when I do this. Any idea ?

Thank in advance

maximeRoudier avatar Oct 09 '21 09:10 maximeRoudier

Hi maximeRoudier, I had the same problem, and I came up with a solution myself. I am sharing the article I wrote with you. The language of the article is Turkish, if I have time, I would like to help you with the part you do not understand.

https://serhatsait.medium.com/webpack-nedir-kurulumu-ve-kullan%C4%B1m%C4%B1-nas%C4%B1ld%C4%B1r-d75b013411a7

serhatsait avatar Nov 03 '21 02:11 serhatsait

1_3iYutG2dLKEakU35oqsnDA

serhatsait avatar Nov 03 '21 07:11 serhatsait

Hi @serhatsait, I'm glad you wrote this article, I don't understand Turkish language but I translated it so I understood most of the content and it seems really interesting. The project I was doing is paused at the moment but I'll get into it, when I'll have time and I'm sure your article will help :) Thanks a lot !

maximeRoudier avatar Nov 03 '21 08:11 maximeRoudier

I'm glad the article was helpful to you. If you need support, you can reach me at [email protected]. Based on this project, I made updates on it, and tonight I updated to webpack5 version. I fixed the hot reload feature.

I wish you good work..:)

serhatsait avatar Nov 03 '21 10:11 serhatsait