jharris4 / html-webpack-tags-plugin

lets you define html tags to inject with html-webpack-plugin
MIT License
255 stars 31 forks source link

Extension forgiveness #6

Closed justincorrigible closed 7 years ago

justincorrigible commented 7 years ago

Noticed a JS file served without the extension will not be recognised as a valid asset to include (as stated well in the instructions, resulting in an error). What would be a quick and easy way to turn that extension enforcement, and is there any chance we could make that a feature/option?

jharris4 commented 7 years ago

I'd been meaning to get to this for a while... Just tagged version 0.0.6 with two new options: jsExtensions and cssExtensions.

Check out the update README for details / examples.

mmiller42 commented 7 years ago

This is a nice enhancement, but it'd be even cooler if you could set this on an individual asset level, manually. For example, the URL https://fonts.googleapis.com/css?family=Material+Icons loads a CSS document but doesn't have any extension at all. It'd be neat if, when specifying assets, you could simply override its detection, e.g.

assets: [
  'some/file.js',
  { path: 'https://fonts.googleapis.com/css?family=Material+Icons', type: 'css' },
  'some/file.css',
]

Would you be open to that kind of configuration? If so, I'd be happy to contribute and open up a PR for this kind of thing.

jharris4 commented 7 years ago

Absolutely! And I see you've already created one (#8), I'll take a look