Skip to content

Instantly share code, notes, and snippets.

@pertrai1
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save pertrai1/fc79f78e9e4e2fa079a2 to your computer and use it in GitHub Desktop.

Select an option

Save pertrai1/fc79f78e9e4e2fa079a2 to your computer and use it in GitHub Desktop.
RequireJS Config
/*jslint node: true, nomen: true, unparam: true */
/*global jquery, _, $ */
'use strict';
require.config({
// 3rd party script alias names (Easier to type "jquery" than "libs/jquery, etc")
// probably a good idea to keep version numbers in the file names for updates checking
paths: {
// Core Libraries
"jquery": "_assets/libs/jquery/jquery-1.9.1",
//"jquerymobile": "_assets/libs/jqm/jquery.mobile-1.3.1",
"jquerymobile": "_assets/libs/jqm/jquery.mobile-1.3.1-custom", // option corners, custom longview icons, modified getInheritedTheme
"underscore": "_assets/libs/marionette/lodash-1.3.1", // 2.4.1 / 1.3.1
//"backbone": "_assets/libs/marionette/backbone-1.0.0", // 1.1.0 / 1.0.0
"backbone": "_assets/libs/marionette/backbone-1.0.0-custom", // previousFragment
"localstorage": "_assets/libs/backbone-localstorage-15.5.5/backbone.localStorage",
"marionette": "_assets/libs/marionette/backbone.marionette-1.1.0", // 1.4.0 / 1.1.0
"handlebars": "_assets/libs/handlebars/handlebars-1.0.0",
"hbs": "_assets/libs/handlebars/hbs-0.4.0",
"i18nprecompile": "_assets/libs/handlebars/i18nprecompile",
"json2": "_assets/libs/marionette/json2",
"jasmine": "_assets/libs/jasmine/jasmine-1.3.1",
"jasmine-html": "_assets/libs/jasmine/jasmine-html-1.3.1",
"async": "_assets/libs/async/async-0.2.9",
"modernizr": "_assets/libs/modernizr/modernizr-2.6.2.min",
"moment": "_assets/libs/moment/moment-2.4.0.min",
'highcharts-default': '_assets/libs/highcharts/highcharts',
'highcharts': '_assets/libs/highcharts/highcharts-more',
"fastclick": '_assets/libs/fastclick/fastclick.min',
// Theming
"jquerymobile-config": "_assets/libs/jqm/jquery.mobile-config",
// Utilities
"parser": "core/utilities/parser",
// Plugins
"text": "_assets/libs/require/plugins/text",
"jasminejquery": "_assets/libs/jquery/plugins/jasmine-jquery",
"jquery.form": "_assets/libs/jquery/plugins/jquery.form.min-20130616",
"jquery.formparams": "_assets/libs/jquery/plugins/jquery.formparams",
"jquery-datatable": "_assets/libs/jquery/jquery-datatable/jquery.dataTables.min",
"jquery-scroll": "_assets/libs/jquery/jquery-scroll/jquery.scrollstart.scrollstop",
"jquerymobile-autocomplete": "_assets/libs/jqm/jqm-autocomplete/jquery.mobile.accessible-autocomplete",
"jquerymobile-datepicker": "_assets/libs/jqm/jqm-datepicker/jquery.accessibleDatePicker",
"jquerymobile-timepicker": "_assets/libs/jqm/jqm-timepicker/jquery.accessibleTimePicker",
"Portal": "core/Portal",
"Controller": "core/Controller",
"Router": "core/Router",
"Init": "core/init",
"OrdersViewer": "widgets/orders-viewer/jquery.mobile.ordersManagement-0.1",
"NoteWriter": "widgets/note-writer/jquery.mobile.progressNotes-0.1",
"cordova": "_assets/libs/phonegap/cordova",
"plistLoader": "_assets/libs/phonegap/plugins/plistLoader",
"nativeAuthLib": "_assets/libs/phonegap/plugins/nativeAuthLib",
"nativeAppLauncher": "_assets/libs/phonegap/plugins/nativeAppLauncher",
"phonegapStarter": "_assets/libs/phonegap/phonegapStarter",
// Test directory
"test": "test"
},
// Sets the configuration for your third party scripts that are not AMD compatible
shim: {
"jquery-datatable": {
deps: ["jquery"]
},
"jquery-scroll": {
deps: ["jquery"]
},
"jquerymobile": {
deps: ["jquery", "jquerymobile-config"]
},
"jquerymobile-autocomplete": {
deps: ["jquery", "jquerymobile"]
},
"jquerymobile-datepicker": {
deps: ["jquery", "jquerymobile", "jquery-scroll"]
},
"jquerymobile-timepicker": {
deps: ["jquery", "jquerymobile", "jquery-scroll"]
},
"OrdersViewer": {
deps: ["jquery", "jquerymobile", "underscore"]
},
"NoteWriter": {
deps: ["jquery", "jquerymobile", "underscore", "jquerymobile-autocomplete", "jquerymobile-datepicker", "jquerymobile-timepicker"]
},
'highcharts-default': {
deps: ['jquery']
},
'highcharts': {
deps: ['highcharts-default'],
"exports": "Highcharts"
},
"backbone": {
"deps": ["underscore", "jquery"],
"exports": "Backbone"
},
"marionette": {
"deps": ["underscore", "backbone", "jquery"],
"exports": "Marionette"
},
"handlebars": {
"exports": "Handlebars"
},
"jasmine": {
"exports": "jasmine"
},
"jasmine-html": {
"deps": ["jasmine"],
"exports": "jasmine"
},
"modernizr": {
"exports": "modernizr"
},
"cordova": {
"deps": ["phonegapStarter", "plistLoader", "nativeAuthLib", "nativeAppLauncher"]
}
},
// hbs config - must duplicate in Gruntfile.js Require build
hbs: {
templateExtension: "html",
helperDirectory: "_assets/templates/helpers/",
i18nDirectory: "_assets/templates/i18n/",
compileOptions: {} // options object which is passed to Handlebars compiler
}
});
require(['Init']);
requirejs: {
compile: {
options: {
mainConfigFile: 'config.js',
baseUrl: '.',
name: 'Portal',
include: ['config'],
out: 'core/<%= pkg.name %>-<%= pkg.version %>.min.js'
}
}
}
<script data-main="config" src="_assets/libs/require/require.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment