Webpack output output multiple directories?

problem description

want to configure webpack to package multiple pages, but there is a hierarchical relationship between multiple pages. Can output output multiple levels?

the platform version of the problem and what methods you have tried

output has only been configured with pathname

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

webpack multi-page packaging
clipboard.png

,

clipboard.png

want to generate
index/index.html
index/content/content.html

news/news.html

Dec.03,2021

absolutely. Use name of entry as appropriate splicing.
such as js :

filename: '[name]/[name].js'

css :

new MiniCssExtractPlugin({
  filename: '[name]/[name].css'
})
Menu