lmao, wtf?

my brain just exploded trying to figure out what this is doing here
v1.18.x
psychobunny 11 years ago
parent d5d686b701
commit 8de978fbcf

@ -6,16 +6,11 @@ var path = require('path'),
meta = require('../meta'), meta = require('../meta'),
db = require('../database'), db = require('../database'),
plugins = require('../plugins'), plugins = require('../plugins'),
middleware = require('../middleware'), middleware = require('../middleware');
minificationEnabled = false;
function sendMinifiedJS(req, res, next) { function sendMinifiedJS(req, res, next) {
if (!minificationEnabled) { res.set('X-SourceMap', '/nodebb.min.js.map');
res.set('X-SourceMap', '/nodebb.min.js.map');
}
return res.type('text/javascript').send(meta.js.cache); return res.type('text/javascript').send(meta.js.cache);
} }
@ -58,8 +53,6 @@ module.exports = function(app, middleware, controllers) {
app.get('/robots.txt', controllers.robots); app.get('/robots.txt', controllers.robots);
app.get('/css/previews/:theme', controllers.admin.themes.get); app.get('/css/previews/:theme', controllers.admin.themes.get);
if (!minificationEnabled) { app.get('/nodebb.min.js.map', middleware.addExpiresHeaders, sendSourceMap);
app.get('/nodebb.min.js.map', middleware.addExpiresHeaders, sendSourceMap); setupPluginSourceMapping(app);
setupPluginSourceMapping(app);
}
}; };

Loading…
Cancel
Save