emaphp / underscore-template-loader

A Underscore and Lodash template loader for Webpack
MIT License
104 stars 24 forks source link

Add fallback loader #12

Closed jantimon closed 8 years ago

jantimon commented 8 years ago

I would love to use the underscore-template-loader as the default loader for the html-webpack-plugin. However this would break as this loader requires a loader for all img tags.

This pull request has a fallback which prevents errors if no image file loader was specified.

See also: #11

emaphp commented 8 years ago

I've had to do a few changes to some of the files, namely removing the strong lodash dependency. Mocha does not complain and I've also tested using a personal project before uploading. These changes are now available in v0.6.0, which I just published. Docs have been updated accordingly. Let me know if everything works fine for you. Thanks for your collaboration.

jantimon commented 8 years ago

Wow thanks alot - just one question this module does not work without lodash - why isn't it a dependency? When I use this project as dependency my project fails unless I add lodash myself

SpaceK33z commented 8 years ago

Wouldn't it make sense to add the lodash dependency in your own package? Then you can choose between underscore or lodash, one of which you probably have already installed anyway. Maybe add this as a peerDependency?

jantimon commented 8 years ago

peerDependencies don't exist anymore - if you have installed underscore the loader will use underscore -otherwise it will fallback to lodash