Sto provando ad utilizzare il compressore YUI per il file .js basato su socket.io (sì, so che è script lato server e non richiede la minifrazione, ma è requisito in modo da avere un valore inferiore controllo). Il mio codice è simile a questo:Nome mancante dopo. operatore YUI Compressore per file socket.io js
fs.readFile('../examples/example.xml', function(err, data) {
if (err) throw err;
// parsing the new xml data and converting them into json file
var json = parser.toJson(data);
// adding the time of the last update
json.time = new Date();
// send the new data to the client
socket.volatile.emit('notification', json);
});
Quando eseguo compressore YUI ottengo l'errore @ questa linea:
socket.volatile.emit('notification', json);
[ERROR] 36:22:missing name after . operator
suppongo che sta gettando errore becase volatili è giusto parola chiave? Qualcuno può guidarmi come sbarazzarsi di questo errore.
presa [ 'volatili']. Emettere() – user32225
@ user32225 wow !! è fantastico. Se lo pubblichi come risposta, posso prevederlo e accettarlo :) –
Thaks per la mancia, lo farò. – user32225