colyseus.js and Cocos Creator

how use colyseus.js in Cocos Creator ?

var Colyseus = require("colyseus");
    extends: cc.Component,

    // use this for initialization
    onLoad: function () {
        var client = new Colyseus.Client('ws://localhost:2657');

Colyseus == undefined


Hey @colyseus, (you should pick another username btw, :sweat_smile:)

AFAIK, Cocos Creator doesn't play nice with NPM modules. So, you'd need to download and use the distribution file directly:

Hope this helps! Cheers!

build with colyseus .js 0.9.33 version.