unbroken-dome / indexhtml-webpack-plugin

Index HTML plugin for Webpack
MIT License
42 stars 5 forks source link

injecting css when the entry point contains both css and js #9

Closed squirmy closed 1 year ago

squirmy commented 8 years ago

If I have an entry point (ie. app.js) which contains both javascript and css, is there currently a way to get the css file into a link in the html file?

I found a way, but had to modify the plugin to support it. https://github.com/squirmy/indexhtml-webpack-plugin/

Here's an example of it in use: https://github.com/squirmy/vue-loader-example/

The implementation is working for me, but perhaps doesn't feel 100% as it assumes that you're wanting a .css file to be linked. I feel like this a good feature to have - I'm happy to take some feedback and polish it up if needs be.

Could this be related to #2 ?

squirmy commented 8 years ago

I've changed my implementation a little so it aligns with #2.