numical / script-ext-html-webpack-plugin

Enhances html-webpack-plugin functionality with different deployment options for your scripts including 'async', 'preload', 'prefetch', 'defer', 'module', custom attributes, and inlining.
MIT License
588 stars 105 forks source link

Multiple html plugins #43

Closed furstenheim closed 4 years ago

furstenheim commented 6 years ago

Hi, I have the following use case. In a webpack config I'm creating several html files as in this question. I can't find any way in the documentation to treat that case with script ext html webpack plugin. That is:

plugins: [
  new HtmlWebpackPlugin({
    filename: 'index.html',
    template: 'src/index.html',
    chunks: ['main']
  }),
  new HtmlWebpackPlugin({
    filename: 'example.html',
    template: 'src/example.html',
    chunks: ['exampleEntry']
  }),
  // I want this to affect only index.html
  new ScriptExtHtmlWebpackPlugin()     
]

Is it possible to do it with this plugin? In the README there are only examples on how to filter the chunks, but not the destination.

Thanks

numical commented 6 years ago

Hi, It would be possible to modify the plugin to use the same mechanism I used for the sister plugin style-ext-html-webpack-plugin - see the documentation here. However there would be a fair bit of code and additional testing to write. It can go into my backlog but unlikely to be done soon. Happy to accept a PR ... :-)

roypeled commented 6 years ago

I'm having the same problem. When there are multiple HtmlWebpackPlugin, ScriptExtHtmlWebpackPlugin completely fails to work.

omeryagmurlu commented 6 years ago

I'm also having the same problem. Especially with Electron apps, where multiple html files for multiple renderers is a nice necessity

creage commented 4 years ago

Any progress on that issue?

XiaoWinter commented 4 years ago

I've seen a lot of similar issues in this project,Is there any way to deal with this problem?

numical commented 4 years ago

Hello - I'm sorry to say that this plugin is no longer being maintained. I have tried to close all issues ahead of doing this but instead have found that the issue list just keeps growing. I simply do not have the time to keep up. Sorry. Please keep an eye on the README where I will record anyone who forks this repo with the intention to supporting it in the future.