pomelo-cn
pomelo-cn copied to clipboard
web server 怎么调用shared里的code.js
模仿捡宝里的code.js把一些常量定义在这里,game server能正常访问,但是webserver访问不了
window.onload =function() { var Code = require('../../shared/code.js'); console.log(Code); init(); }
目录没错,在index.html里写的代码,WebStorm提示目录没错,command+左键能正常进入文件,但是运行提示 Uncaught Error: Failed to require "../../shared/code.js" from "root"
客户端要用script标签加进去