Skip to content

Adds underscore template support to brunch minus module-wrapping for commonjs/amd.

Notifications You must be signed in to change notification settings

slattery/static-underscore-brunch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

static-underscore-brunch

Adds underscore template support to brunch without wrapping the output in modules of type commonjs/amd.

Usage

Add "static-underscore-brunch": "x.y.z" to package.json of your brunch app.

Pick a plugin version that corresponds to your minor (y) brunch version.

If you want to use git version of plugin, add "static-underscore-brunch": "git+ssh://git@github.com:slattery/static-underscore-brunch.git".

Useful convensions

Brunch concatenates all your files in app/, test/ and vendor/ directories to two files by default:

  • app.js contains your application code.
  • vendor.js contains code of libraries you depend on (e.g. jQuery, Underscore).

You may wish to add a template file handler that points to a different output file. Inside config.coffee:

templates:
	defaultExtension: 'jst'
 	joinTo: 
 		'javascripts/templates.js': /^app\/templates/

You can then place your templates.js below your vendor.js and above your apps.js

Configuration options

Output is based on plugins.static_underscore.output in config.coffee:

plugins:
	static_underscore:
 		output: 'source'

Output options are:

  • source (default) will be pre-compiled to the output file, using the filename (minus extension) as the var name.
  • call will print underscore template calls to the output file: filenameAsVarName = _.template( <your markup here/> );

Cheers

About

Adds underscore template support to brunch minus module-wrapping for commonjs/amd.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published