maxparm / node-underscorify

Underscore template pre-compiler for browserify
MIT License
31 stars 12 forks source link

Doesn't Appear to Observe Options Passed via grunt-browserify #14

Open zebulonj opened 9 years ago

zebulonj commented 9 years ago

I'm attempting to pass templateSettings via grunt-browserify. My Gruntfile looks like:

var template_opts = {
    interpolate:    /\{\{(.+?)\}\}/g,
    escape:         /\{-(.+?)\}/g,
    evaluate:       /<%(.+?)%>/g
};

module.exports = function( grunt ) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        browserify: {
            spec: {
                options: {
                    transform: [['node-underscorify', { templateSettings: template_opts }]],
                    browserifyOptions: {
                        debug: true
                    }
                },
                src:    ['app/config.js','spec/**/*-spec.js'],
                dest:   'spec/bundle.js'
            }
        }
    });

    grunt.loadNpmTasks( 'grunt-browserify' );
};

The compiled code doesn't use the specified delimiters.

zebulonj commented 9 years ago

This is not a node-underscorify issue. No options are being passed from grunt-browserify.

zebulonj commented 9 years ago

Dug deeper. This is an issue with node-underscorify. The options configured in the Gruntfile (above) are being passed to the transform as a second argument.