aberman / html2js-brunch

A Brunch version of grunt-html2js
MIT License
1 stars 3 forks source link

Single module output? #3

Open dragonautdev opened 8 years ago

dragonautdev commented 8 years ago

Hello there!

First of all, thanks for this awesome work. Now, a question. I'm trying to use this plugin for the first time now, and I wonder if there's any way so that it can generate a single angular module for all templates. According to the main page, it's supposed to do so; however, in my case, it's generating a different module for each template.

Maybe I'm missing something?

Here are the relevant parts of my brunch-config.js file: templates: { joinTo: { 'app/js/templates.js': /^app\/views\// } } html2js: { options: { base: 'app/views/' } }

dragonautdev commented 8 years ago

I've looked at the source code for this plugin a bit and found that there's a part of the code which does exactly what I need. I'm specifically talking about the onCompile method. If I'm understanding that method correctly, it appears to be in charge of generating a single angular module which depends on each individual module generated for each template. However in my case, the generated file does not contain the section this method is supposed to create.

Any ideas? I'd appreciate any suggestions you can have.

thanks!

aberman commented 8 years ago

The last time I used this plugin it worked as expected generating a single JS file for all my templates. I haven't used it in several years and I don't know if Brunch has changed that might be interfering with the generation of the JS file.

Do all of your templates have an extension of .tpl.html?