Ich versuche, YUI-Kompressor für socket.io-basierte .js-Datei zu verwenden (ja, ich weiß, es ist Server-Skript und erfordert keine minfication, aber es ist Voraussetzung, damit ich weniger habe Steuerung). Mein Code ist wie folgt:Fehlender Name nach. Operator YUI Compressor für socket.io js files
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);
});
Wenn ich ausführen YUI Kompressor ich Fehler @ dieser Zeile:
socket.volatile.emit('notification', json);
[ERROR] 36:22:missing name after . operator
Ich nehme an, es Fehler wirft becase flüchtig ist Schlüsselwort richtig? Kann mir jemand helfen, diesen Fehler loszuwerden?
Buchse in Anführungszeichen [ 'volatile']. Emittieren() – user32225
@ user32225 wow !! das ist großartig. Wenn du es als Antwort postest, kann ich es aufheben und akzeptieren :) –
Thaks für den Tipp, werde ich machen. – user32225