v1.18.x
Julian Lam 11 years ago committed by Julian Lam
parent d565de60d0
commit 7cdcb83a98

@ -24,7 +24,7 @@ Minifier.js.minify = function (scripts, minify, callback) {
options.outSourceMap = 'nodebb.min.js.map'; options.outSourceMap = 'nodebb.min.js.map';
options.mangle = false; options.mangle = false;
options.compress = false; options.compress = false;
options.prefix = __dirname.split(path.sep).length; // options.prefix = __dirname.split(path.sep).length;
} }
try { try {

@ -5,6 +5,7 @@ var winston = require('winston'),
path = require('path'), path = require('path'),
async = require('async'), async = require('async'),
_ = require('underscore'), _ = require('underscore'),
os = require('os'),
plugins = require('../plugins'), plugins = require('../plugins'),
emitter = require('../emitter'), emitter = require('../emitter'),
@ -123,6 +124,11 @@ module.exports = function(Meta) {
next(err); next(err);
}); });
}, function(err) { }, function(err) {
// Translate into relative paths
Meta.js.scripts = Meta.js.scripts.map(function(script) {
return path.relative(path.resolve(__dirname, '../../'), script).replace(/\\/g, '/');
});
Meta.js.prepared = true; Meta.js.prepared = true;
callback(err); callback(err);
}); });
@ -163,4 +169,11 @@ module.exports = function(Meta) {
Meta.js.minifierProc.kill('SIGTERM'); Meta.js.minifierProc.kill('SIGTERM');
} }
}; };
// OS detection and handling
// if (os.platform() === 'win32') {
// Meta.js.scripts = Meta.js.scripts.map(function(script) {
// return script.replace(/\//g, '\\');
// });
// }
}; };
Loading…
Cancel
Save