2016-12-23 01:44:46 +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,
|
|
|
|
optimize: "none",
|
|
|
|
paths: {
|
|
|
|
underscore : 'components/underscore/underscore-min',
|
|
|
|
backbone : 'components/backbone/backbone-min',
|
2017-07-11 22:34:23 +08:00
|
|
|
jed: 'components/jed/jed',
|
2016-12-23 01:44:46 +08:00
|
|
|
jquery: 'components/jquery/jquery.min',
|
2017-07-11 22:34:23 +08:00
|
|
|
json: 'components/requirejs-plugins/src/json',
|
|
|
|
text: 'components/requirejs-text/text',
|
2018-12-14 18:58:52 +08:00
|
|
|
bootstrap: 'components/bootstrap/dist/js/bootstrap.min',
|
2016-12-23 01:44:46 +08:00
|
|
|
bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min',
|
2018-08-09 21:28:25 +08:00
|
|
|
"jquery-ui": 'components/jquery-ui/jquery-ui.min',
|
2017-07-11 22:34:23 +08:00
|
|
|
moment: 'components/moment/min/moment-with-locales',
|
2016-12-23 01:44:46 +08:00
|
|
|
codemirror: 'components/codemirror',
|
2018-01-09 12:57:08 +08:00
|
|
|
xterm: 'components/xterm.js/index',
|
2018-02-09 21:41:38 +08:00
|
|
|
'xtermjs-fit': 'components/xterm.js-fit/index',
|
2016-12-23 01:44:46 +08:00
|
|
|
typeahead: 'components/jquery-typeahead/dist/jquery.typeahead',
|
|
|
|
contents: 'empty:',
|
|
|
|
custom: 'empty:',
|
|
|
|
},
|
|
|
|
map: { // for backward compatibility
|
|
|
|
"*": {
|
|
|
|
"jqueryui": "jquery-ui",
|
|
|
|
}
|
|
|
|
},
|
|
|
|
shim: {
|
|
|
|
typeahead: {
|
|
|
|
deps: ["jquery"],
|
|
|
|
exports: "typeahead"
|
|
|
|
},
|
|
|
|
underscore: {
|
|
|
|
exports: '_'
|
|
|
|
},
|
|
|
|
backbone: {
|
|
|
|
deps: ["underscore", "jquery"],
|
|
|
|
exports: "Backbone"
|
|
|
|
},
|
|
|
|
bootstrap: {
|
|
|
|
deps: ["jquery"],
|
|
|
|
exports: "bootstrap"
|
|
|
|
},
|
|
|
|
bootstraptour: {
|
|
|
|
deps: ["bootstrap"],
|
|
|
|
exports: "Tour"
|
|
|
|
},
|
|
|
|
"jquery-ui": {
|
|
|
|
deps: ["jquery"],
|
|
|
|
exports: "$"
|
2017-01-04 20:20:13 +08:00
|
|
|
},
|
2016-12-23 01:44:46 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
exclude: [
|
|
|
|
"custom/custom",
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
rjs(rjs_config, console.log, function (err) {
|
|
|
|
console.log("Failed to build", name, err);
|
|
|
|
process.exit(1);
|
|
|
|
});
|