You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can I use conditional comments to import entry script? #155
when I use HtmlWebpackPlugin, It's for certain to import or not import an entry, using chunks.
I hope to generate conditional comments in HTML file, like:
Activity
jantimon commentedon Jan 5, 2016
You have to create a custom index file:
https://github.com/ampedandwired/html-webpack-plugin/blob/master/default_index.html#L15
Pliman commentedon Jan 6, 2016
Ops, I missed that part.
works great for me, thanks a lot.
my scripts:
jantimon commentedon Jan 7, 2016
Cool 👍
saalmaan commentedon May 12, 2016
syntax has changes now, change regular expression according to your chunks
<!--[if lte IE 9]> <% for (var chunk in htmlWebpackPlugin.files.chunks) { %> <% if ((htmlWebpackPlugin.files.chunks[chunk].entry).match('ie')) {%> <script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script> <% } %> <% } %> <![endif]-->Pliman commentedon May 23, 2016
Thanks for notification.
giiska commentedon Nov 22, 2016
@saalmaan How to filter those ie chunks from regular injection?
jantimon commentedon Nov 22, 2016
@bammoo take a look at the html-webpack-exclude-assets-plugin by @jamesjieye - it allows filtering by regular expressions
lastobelus commentedon Jan 16, 2018
link is broken, even when changing github user.
lock commentedon May 31, 2018
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.