diff --git a/README.md b/README.md index 8208bfcee..dab2a4bc7 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,36 @@ pip install --pre -e . jupyter notebook ``` +## Working on the frontend +The Notebook frontend depends on a wide set of libraries and package managers. +NPM is used to macro manage the frontend build process. You can build the +frontend Javascript and LESS by running + +``` +npm run build +``` + +If you need to build the Javascript alone + +``` +npm run build:js +``` + +Or LESS + +``` +npm run build:css +``` + +To build specific sub components, separate using a colon. i.e. to build only +the terminal's Javascript + +``` +npm run build:js:terminal +``` + +To clean all built output + +``` +npm run clean +``` diff --git a/notebook/amd.js b/notebook/amd.js index 30b0d9b91..4cf2baf32 100644 --- a/notebook/amd.js +++ b/notebook/amd.js @@ -17,14 +17,19 @@ glob(path.join(source, "**/*.js"), function(err, files) { if (err) { console.error('Could not read file ' + file, err); } else { - mkdirp(path.dirname(toFile), function(err) { if (err) {console.error('Could not mkdirp ', err);} }); - fs.writeFile(toFile, amdWrap(data), function(err) { - if(err) { - return console.error('Could not write file ' + toFile, err); - } + mkdirp(path.dirname(toFile), function(err) { + if (err) { + console.error('Could not mkdirp ', err); + } else { + fs.writeFile(toFile, amdWrap(data), function(err) { + if(err) { + return console.error('Could not write file ' + toFile, err); + } + }); + } }); } }); }); } -}); \ No newline at end of file +}); diff --git a/package.json b/package.json index 4bfeecf3b..10b5caeb4 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "browserify": "^11.0.1", "codemirror": "~5.5", "concurrently": "^0.1.1", + "glob": "^5.0.14", "jquery": "^2.0", "jquery-ui": "~1.10", "less": "~2",