Skip to content

Commit

Permalink
restore r.js-based build system from 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Dec 22, 2016
1 parent b6de78e commit f377b3a
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 94 deletions.
5 changes: 4 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
"bootstrap": "components/bootstrap#~3.3",
"bootstrap-tour": "0.9.0",
"codemirror": "components/codemirror#~5.16",
"es6-promise": "~1.0",
"font-awesome": "components/font-awesome#~4.2.0",
"google-caja": "5669",
"jquery": "components/jquery#~2.0",
"jquery-typeahead": "~2.0.0",
"jquery-ui": "components/jqueryui#~1.10",
"marked": "~0.3",
"MathJax": "components/MathJax#~2.6",
"moment": "~2.8.4",
"requirejs": "~2.1",
"text-encoding": "~0.1",
"underscore": "components/underscore#~1.8.3"
"underscore": "components/underscore#~1.8.3",
"xterm.js": "sourcelair/xterm.js#~2.1.0"
}
}
68 changes: 68 additions & 0 deletions tools/build-main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// 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',
jquery: 'components/jquery/jquery.min',
bootstrap: 'components/bootstrap/js/bootstrap.min',
bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min',
"jquery-ui": 'components/jquery-ui/ui/minified/jquery-ui.min',
moment: 'components/moment/moment',
codemirror: 'components/codemirror',
xterm: 'components/xterm.js/dist/xterm',
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: "$"
}
},

exclude: [
"custom/custom",
]
};

rjs(rjs_config, console.log, function (err) {
console.log("Failed to build", name, err);
process.exit(1);
});
93 changes: 0 additions & 93 deletions webpack.config.js

This file was deleted.

0 comments on commit f377b3a

Please sign in to comment.