169 lines
4.6 KiB
JavaScript
169 lines
4.6 KiB
JavaScript
// 1. Install nodejs (it will automatically installs requirejs)
|
|
|
|
//- assuming the folder structure for your app is:
|
|
// app
|
|
// css
|
|
// img
|
|
// js
|
|
// main.js
|
|
// index.html
|
|
// build
|
|
// app.build.js
|
|
// r.js (downloaded from requirejs website)
|
|
|
|
// 2. the command line to run:
|
|
// $ node r.js -o app.build.js
|
|
//
|
|
|
|
({
|
|
//- paths are relative to this app.build.js file
|
|
appDir: "",
|
|
baseUrl: "js",
|
|
//- this is the directory that the new files will be. it will be created if it doesn't exist
|
|
dir: "./app-build_prod",
|
|
paths: {
|
|
jquery: 'empty:',
|
|
underscore: 'libs/underscore-min',
|
|
jQueryPlugins: 'libs/jQueryPlugins',
|
|
backbone: 'libs/backbone-min',
|
|
text: 'libs/text',
|
|
jqxcore: 'empty:',
|
|
jqxbuttons: 'empty:',
|
|
jqxpanel: 'empty:',
|
|
jqxscrollbar: 'empty:',
|
|
jqxtree: 'empty:',
|
|
jqxwindow: 'empty:',
|
|
jqxmenu: 'empty:',
|
|
jqxcombobox: 'empty:',
|
|
jqxdata: 'empty:',
|
|
jqxrating: 'empty:',
|
|
jqxtabs: 'empty:',
|
|
jqxlistbox: 'empty:',
|
|
jqxdropdownlist: 'empty:',
|
|
jqxdropdownbutton: 'empty:',
|
|
jqxeditor: 'empty:',
|
|
jqxcolorpicker: 'empty:',
|
|
jqxgrid: 'empty:',
|
|
jqxgrid_selection: 'empty:',
|
|
jqxgrid_columnsresize: 'empty:',
|
|
jqxgrid_filter: 'empty:',
|
|
jqxinput: 'empty:',
|
|
jqxdragdrop: 'empty:',
|
|
jqxnumberinput: 'empty:'
|
|
},
|
|
shim: {
|
|
jqm: {
|
|
deps: [ 'jquery' ]
|
|
},
|
|
jQueryPlugins: {
|
|
deps: [ 'jquery' ]
|
|
},
|
|
"jqxcore": {
|
|
export: "$",
|
|
deps: ['jquery']
|
|
},
|
|
"jqxbuttons": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxwindow": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxpanel": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxscrollbar": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxtree": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxrating": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxinput": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxtabs": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxnumberinput": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxdropdownbutton": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxcolorpicker": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxeditor": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore", "jqxscrollbar", "jqxcombobox", "jqxwindow",
|
|
"jqxcolorpicker", "jqxdropdownbutton", "jqxdropdownlist", "jqxlistbox", "jqxbuttons"]
|
|
},
|
|
"jqxgrid": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxgrid_selection": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore", "jqxgrid"]
|
|
},
|
|
"jqxgrid_columnsresize": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore", "jqxgrid"]
|
|
},
|
|
"jqxgrid_filter": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore", "jqxgrid"]
|
|
},
|
|
"jqxmenu": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxcombobox": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore", "jqxlistbox"]
|
|
},
|
|
"jqxdata": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxdragdrop": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore"]
|
|
},
|
|
"jqxlistbox": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore", "jqxscrollbar", "jqxdragdrop"]
|
|
},
|
|
"jqxdropdownlist": {
|
|
export: "$",
|
|
deps: ['jquery', "jqxcore", "jqxlistbox"]
|
|
}
|
|
},
|
|
optimize: "uglify2",
|
|
modules: [
|
|
{
|
|
name: "main",
|
|
exclude: [
|
|
'libs/jQueryPluginsCollection',
|
|
'plugins/jquery.mobile.alphascroll.min',
|
|
'plugins/jquery.rating.pack'
|
|
]
|
|
},
|
|
{ name: "libs/jQueryPluginsCollection" }
|
|
],
|
|
preserveLicenseComments: false,
|
|
fileExclusionRegExp: /\.git/
|
|
}) |