2015-04-30 05:04:59 +08:00
|
|
|
// build main.min.js
|
|
|
|
// spawned by gulp to allow parallelism
|
|
|
|
|
|
|
|
var rjs = require('requirejs').optimize;
|
|
|
|
|
|
|
|
var name = process.argv[2];
|
|
|
|
|
|
|
|
var rjs_config = {
|
|
|
|
name: name + '/js/main',
|
|
|
|
out: './notebook/static/' + name + '/js/main.min.js',
|
|
|
|
baseUrl: 'notebook/static',
|
|
|
|
preserveLicenseComments: false, // license comments conflict with sourcemap generation
|
|
|
|
generateSourceMaps: true,
|
2015-07-13 03:13:03 +08:00
|
|
|
optimize: "none",
|
2015-04-30 05:04:59 +08:00
|
|
|
paths: {
|
|
|
|
underscore : 'components/underscore/underscore-min',
|
|
|
|
backbone : 'components/backbone/backbone-min',
|
|
|
|
jquery: 'components/jquery/jquery.min',
|
|
|
|
bootstrap: 'components/bootstrap/js/bootstrap.min',
|
|
|
|
bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min',
|
|
|
|
jqueryui: 'components/jquery-ui/ui/minified/jquery-ui.min',
|
|
|
|
moment: 'components/moment/moment',
|
|
|
|
codemirror: 'components/codemirror',
|
|
|
|
termjs: 'components/term.js/src/term',
|
2015-08-06 05:22:40 +08:00
|
|
|
typeahead: 'components/jquery-typeahead/dist/jquery.typeahead',
|
2015-04-30 05:04:59 +08:00
|
|
|
contents: 'empty:'
|
|
|
|
},
|
|
|
|
shim: {
|
2015-08-06 05:22:40 +08:00
|
|
|
typeahead: {
|
|
|
|
deps: ["jquery"],
|
|
|
|
exports: "typeahead"
|
|
|
|
},
|
2015-04-30 05:04:59 +08:00
|
|
|
underscore: {
|
|
|
|
exports: '_'
|
|
|
|
},
|
|
|
|
backbone: {
|
|
|
|
deps: ["underscore", "jquery"],
|
|
|
|
exports: "Backbone"
|
|
|
|
},
|
|
|
|
bootstrap: {
|
|
|
|
deps: ["jquery"],
|
|
|
|
exports: "bootstrap"
|
|
|
|
},
|
|
|
|
bootstraptour: {
|
|
|
|
deps: ["bootstrap"],
|
|
|
|
exports: "Tour"
|
|
|
|
},
|
|
|
|
jqueryui: {
|
|
|
|
deps: ["jquery"],
|
|
|
|
exports: "$"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
exclude: [
|
|
|
|
"custom/custom",
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
rjs(rjs_config, console.log, function (err) {
|
|
|
|
console.log("Failed to build", name, err);
|
|
|
|
process.exit(1);
|
|
|
|
});
|