Skip to content

Instantly share code, notes, and snippets.

@daffl
Created December 6, 2013 20:43
Show Gist options
  • Select an option

  • Save daffl/7831774 to your computer and use it in GitHub Desktop.

Select an option

Save daffl/7831774 to your computer and use it in GitHub Desktop.
Example configuration for RequireJS and can-compile
cancompile: {
dist: {
src: ['public/app/**/*.mustache'],
out: 'public/dist/views.production.js',
wrapper: 'define([\'can/view/mustache\'], function(can) {\n{{{content}}}\n});'
}
},
requirejs: {
compile: {
options: {
paths: {
jquery: 'bower_components/jquery/jquery',
can: 'bower_components/canjs/amd/can',
lodash: 'bower_components/lodash/lodash',
bootstrap: 'app/lib/bootstrap',
fileInput: 'app/lib/bootstrap.file-input',
views: 'dist/views.production'
},
shim: {
bootstrap: {
deps: [ 'jquery' ],
exports: '$'
}
},
baseUrl: 'public/',
name: 'app/index',
almond: true,
out: 'public/dist/production.min.js'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment