jantimon / html-webpack-plugin

Simplifies creation of HTML files to serve your webpack bundles
MIT License
10.71k stars 1.31k forks source link

[name] is not acceptable in filename option #553

Closed rdandnayak closed 6 years ago

rdandnayak commented 7 years ago

Here is my configuration in webppack.config.js

new HtmlWebpackPlugin({
      template: 'src/layouts/index.ejs',
      filename: '[name]/index.html',
 }),

for above config [name] is outputting as 0.html and also i want to generate it in specific folder just like [name]/[name].html

is this supported in this plugin? or any easy workaround available

I will be having multiple directories like this to be created, its multi page web application. or if you can suggest better approach that would be helpful

LeoMartinDev commented 7 years ago

+1

simshanith commented 7 years ago

For a currently working approach, see discussion https://github.com/jantimon/html-webpack-plugin/issues/218

Luomusha commented 7 years ago

+1 When I want to rename my HTML template files dynamically,I met this problem,too.And I perfer no coding in config file.

kee0624 commented 7 years ago

I think if we can do a same thing like panini http://foundation.zurb.com/sites/docs/panini.html will be good. it provide a dynamic filename, hot reload page and etc.

Not most of people will keep add new html by changing web.config file, I think for dev also not very user friendly.

york-xtrem commented 7 years ago

I totally agree, I want to change from Gulp to Webpack but without support for static pages / multipage is being a hell ...

I can not find optimal solutions.

I usually use Panini, but if possible with these other template libraries would be great:

Automatically detect multiple pages and inject css and javascript bundles.

Is that possible?

mastilver commented 7 years ago

Give https://github.com/mutualofomaha/multipage-webpack-plugin a try

stale[bot] commented 6 years ago

This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days.

lock[bot] commented 6 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.