Skip to content

Instantly share code, notes, and snippets.

@VirtueMe
Last active December 28, 2015 19:09
Show Gist options
  • Select an option

  • Save VirtueMe/7548080 to your computer and use it in GitHub Desktop.

Select an option

Save VirtueMe/7548080 to your computer and use it in GitHub Desktop.
My r.js grunt config section
define(['aura/aura'], function(Aura) {
'use strict';
var aura = new Aura({
sources: {
'default': 'aura_components'
},
debug: {
enable: true
}
});
aura.start({ components: 'body' }).then(function () {
aura.logger.log('started');
});
});
options: {
baseUrl: 'lib',
optimize: 'uglify2',
preserveLicenseComments: false,
generateSourceMaps: true,
findNestedDependencies: true,
paths: {
aura: 'empty:',
jquery: 'empty:',
underscore: 'empty:',
backbone: 'empty:',
text: 'empty:',
i18n: 'empty:'
},
shim: {
underscore: {
exports: '_'
},
backbone: {
exports: 'Backbone'
},
},
include: ['main', 'app', 'aura_components/registration/main', 'nls/nb-no/messages', 'nls/se/messages', 'nls/fi/messages'],
exclude: ['jquery', 'backbone', 'underscore', 'aura', 'text', 'i18n'],
out: 'webfeature/scripts/main.js'
}
/*
result after run: grunt requirejs:compile
>> Tracing dependencies for:
>> C:/GitHub/LandingPagesEngine/webfeature/scripts/main.js
>> Tracing dependencies for: jquery
>> Tracing dependencies for: backbone
>> Tracing dependencies for: underscore
>> Tracing dependencies for: aura
>> Tracing dependencies for: text
>> Tracing dependencies for: i18n
>> Uglify2 file: C:/GitHub/LandingPagesEngine/webfeature/scripts/main.js
>> C:/GitHub/LandingPagesEngine/webfeature/scripts/main.js
>> ----------------
>> C:/GitHub/LandingPagesEngine/lib/main.js /************ actually just a config file. -***************** /
>> C:/GitHub/LandingPagesEngine/lib/app.js
>> C:/GitHub/LandingPagesEngine/lib/aura_components/registration/models/order.js
>> C:/GitHub/LandingPagesEngine/lib/aura_components/registration/models/model.js
>> C:/GitHub/LandingPagesEngine/lib/aura_components/registration/collections/typ
>> es.js
>> C:/GitHub/LandingPagesEngine/lib/aura_components/registration/views/customer.
>> js
>> C:/GitHub/LandingPagesEngine/lib/aura_components/registration/views/child.js
>> C:/GitHub/LandingPagesEngine/lib/nls/messages.js
>> i18n!nls/messages
>> C:/GitHub/LandingPagesEngine/lib/aura_components/registration/views/app.js
>> C:/GitHub/LandingPagesEngine/lib/aura_components/registration/models/init.js
>> C:/GitHub/LandingPagesEngine/lib/aura_components/registration/main.js
>> C:/GitHub/LandingPagesEngine/lib/nls/nb-no/messages.js
>> C:/GitHub/LandingPagesEngine/lib/nls/se/messages.js
>> C:/GitHub/LandingPagesEngine/lib/nls/fi/messages.js
*/
define(function () {
'use strict';
require.config({
deps: ['app'],
paths: {
'jquerylib': [ '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min', './jquery.min'],
'underscorelib': ['//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min', './underscore-min'],
'backbone': ['//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.0/backbone-min', './backbone-min'],
'textlib': './text',
'i18n': './i18n',
'aura': './',
},
shim: {
'jquerylib': {
exports: '$'
},
'underscorelib': {
exports: '_'
},
'backbone': {
deps: ['jquerylib', 'underscorelib']
}
},
map: {
'*': {
'underscore': 'underscorelib',
'text': 'textlib',
'jquery': 'jquerylib'
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment