emaphp / underscore-template-loader

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

Add option to prepend the filename in the template. #6

Closed SpaceK33z closed 8 years ago

SpaceK33z commented 8 years ago

This makes it easier to debug a complex app using the DevTools. It prepends a HTML comment in which the path of the template is given (relative to the given value of the option).

At my work, designers can save much time with this because they can see exactly in which file they should look by just opening their DevTools.

emaphp commented 8 years ago

Nice! These changes are now available in v0.4.1. Thx @SpaceK33z

SpaceK33z commented 8 years ago

Thank you for releasing it so quickly :). I've noticed there are no tests yet, do you mind if I add some soon?

And maybe add some default settings, like a linter etc.?

emaphp commented 8 years ago

I've been thinking in adding some additional tasks like linting and stuff through gulp. Does that sound good or maybe you prefer grunt? Currently am working on fixing the image issue on included templates and maintining another projects. If you could add some test I would really appreciate it.

SpaceK33z commented 8 years ago

Using grunt or gulp is not necessary; you should do everything via npm scripts. In your package.json you can add something like this:

{
  "scripts": {
    "test": "mocha",
    "lint": "eslint ."
  }
}

Then you can just run npm test to run your tests, or npm run lint to lint the files. webpack also does it this way.

I will take a look at this soon :).