webpack-es6-sass-boilerplate
webpack-es6-sass-boilerplate copied to clipboard
Don't understand how to add multiples pages
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
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

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 !
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..:)