updated dependencies to use latest UglifyJS2, instead of my year-old fork

This commit is contained in:
Julian Lam
2015-07-06 13:19:09 -04:00
parent 1d4efaee68
commit 2d70733fa5
4 changed files with 19 additions and 3 deletions

View File

@@ -141,6 +141,7 @@ module.exports = function(Meta) {
switch(message.type) {
case 'end':
Meta.js.cache = message.minified;
Meta.js.map = message.sourceMap;
onComplete();
break;
case 'hash':

View File

@@ -8,6 +8,16 @@ function sendMinifiedJS(req, res, next) {
res.type('text/javascript').send(meta.js.cache);
}
// The portions of code involving the source map are commented out as they're broken in UglifyJS2
// Follow along here: https://github.com/mishoo/UglifyJS2/issues/700
// function sendJSSourceMap(req, res) {
// if (meta.js.hasOwnProperty('map')) {
// res.type('application/json').send(meta.js.map);
// } else {
// res.redirect(404);
// }
// };
function sendStylesheet(req, res, next) {
res.type('text/css').status(200).send(meta.css.cache);
}
@@ -20,6 +30,7 @@ module.exports = function(app, middleware, controllers) {
app.get('/stylesheet.css', middleware.addExpiresHeaders, sendStylesheet);
app.get('/admin.css', middleware.addExpiresHeaders, sendACPStylesheet);
app.get('/nodebb.min.js', middleware.addExpiresHeaders, sendMinifiedJS);
// app.get('/nodebb.min.js.map', middleware.addExpiresHeaders, sendJSSourceMap);
app.get('/sitemap.xml', controllers.sitemap);
app.get('/robots.txt', controllers.robots);
app.get('/css/previews/:theme', controllers.admin.themes.get);