mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-09-02 01:57:38 +02:00
This commit is contained in:
@@ -92,8 +92,7 @@ module.exports = function(Meta) {
|
||||
process.send({
|
||||
action: 'css-propagate',
|
||||
cache: minified[0],
|
||||
acpCache: minified[1],
|
||||
hash: Meta.css.hash
|
||||
acpCache: minified[1]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -186,14 +185,6 @@ module.exports = function(Meta) {
|
||||
|
||||
Meta.css[destination] = lessOutput.css;
|
||||
|
||||
if (destination === 'cache') {
|
||||
// Calculate css buster
|
||||
var hasher = crypto.createHash('md5');
|
||||
|
||||
hasher.update(lessOutput.css, 'utf-8');
|
||||
Meta.css.hash = hasher.digest('hex').slice(0, 8);
|
||||
}
|
||||
|
||||
// Save the compiled CSS in public/ so things like nginx can serve it
|
||||
if (nconf.get('isPrimary') === 'true') {
|
||||
Meta.css.commitToFile(destination);
|
||||
|
||||
@@ -18,7 +18,6 @@ module.exports = function(Meta) {
|
||||
Meta.js = {
|
||||
cache: '',
|
||||
map: '',
|
||||
hash: +new Date(),
|
||||
scripts: {
|
||||
base: [
|
||||
'public/vendor/jquery/js/jquery.js',
|
||||
@@ -142,8 +141,7 @@ module.exports = function(Meta) {
|
||||
process.send({
|
||||
action: 'js-propagate',
|
||||
cache: Meta.js.cache,
|
||||
map: Meta.js.map,
|
||||
hash: Meta.js.hash
|
||||
map: Meta.js.map
|
||||
});
|
||||
}
|
||||
|
||||
@@ -161,9 +159,6 @@ module.exports = function(Meta) {
|
||||
Meta.js.map = message.sourceMap;
|
||||
onComplete();
|
||||
break;
|
||||
case 'hash':
|
||||
Meta.js.hash = message.payload;
|
||||
break;
|
||||
case 'error':
|
||||
winston.error('[meta/js] Could not compile client-side scripts! ' + message.payload.message);
|
||||
minifier.kill();
|
||||
|
||||
@@ -29,9 +29,7 @@ SocketMeta.reconnected = function(socket, data, callback) {
|
||||
|
||||
emitter.on('nodebb:ready', function() {
|
||||
websockets.server.sockets.emit('event:nodebb.ready', {
|
||||
general: meta.config['cache-buster'],
|
||||
css: meta.css.hash,
|
||||
js: meta.js.hash
|
||||
'cache-buster': meta.config['cache-buster']
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user