See the official documentation: http://cocos2d-x.org/wiki/Cocos_luacompile
.lua files are compiled into .luac files [.lua to .luac]
Try in the project file directory
cocos luacompile -h view help information
cocos luacompile -s ./projects/MyLuaGame/src -d ./projects/MyLuaGame/src -e -k MyLuaKey -b MyLuaSign
./projects/MyLuaGame/src-->lua source file directory
./projects/MyLuaGame/src--" Generate luac storage directory
For the settings of MyLuaKey and MyLuaSign, see AppDelegate.cpp
stack->setXXTEAKeyAndSign("2dxLua", strlen("2dxLua"), "XXTEA", strlen("XXTEA"));
Modify the corresponding key and sign.