Skip to content

Conversation

@dziegler
Copy link

@dziegler dziegler commented Mar 7, 2014

It doesn't seem that the regex/callable in the joinTo clause works properly. E.g.

templates: {
    joinTo: {
        'templates-app.js': /^app/,
        'templates-common.js': /^common/,
        'templates-admin.js': function(path) {
            return /^admin/.test(path);
        }
    }
}

This seems to work as far as filtering out the correct tpl.html files to include, but the top angular.module that gets prepended to the file includes every module, not just the filtered modules.

I'm new to brunch so I don't know if there's a simpler patch, but this seems to work for me.

@dziegler
Copy link
Author

dziegler commented Mar 8, 2014

Also added an option to specify the module name, since this was causing problems for me.

@aberman
Copy link
Owner

aberman commented Mar 10, 2014

I originally had the module name option (like grunt-html2js it was called 'module') in the code but removed it because it didn't make sense for Brunch. Can you explain what issues you ran into without it? The problem with your implementation is that your module name will be the same for all three of your concatenated files, which doesn't work.

I'll look at your other patch tomorrow.

@dziegler
Copy link
Author

I'm concatenating my app and template javascript into one file, e.g.

templates: {
    joinTo: {
        '/dir/app.js': /^app/
    }
}
templates: {
    joinTo: {
        '/dir/app.js': /^app/
    }
}

If I merge it all into app.js then I have to call my template module 'app'. It works but is kind of weird.

For my use case, the reason I have multiple template js files is because they get served for different apps. They don't get loaded together so it's not a problem that they share the same module name, but I agree it might not be ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants