We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
按着你的思路正在实现一个 boilerplate,发现一些问题,nodemon 只是在监听 server 目录下的代码,但是 server 也承担着服务器渲染的工作,会用到 client 下的代码,所以说会出现下面的一些问题:
更新:
看了一下 README 提到了上面的问题,这个问题没有什么解决办法么?😑
The text was updated successfully, but these errors were encountered:
这个问题我也是研究了很久,目前无法解决,即使可以解决,服务端重启再打包会比较耗时,所以也没必要解决
Sorry, something went wrong.
@chikara-chan 这是 @wssgcg1213 写的一个boilerplate,这里面用的是同时监听两个端的代码,并且清除 require 缓存,https://github.com/wssgcg1213/koa2-react-isomorphic-boilerplate/blob/master/bin/development.js#L61, 这可以解决修改客户端代码后,可以热更新,服务器端返回html也会变化,但是使用这个boilerplate的时候,我遇到的一个问题是,我使用 mongoose,当任何代码发生变动,会抛出 Cannot overwrite model once compiled Mongoose 的错误。经过研究发现 mongoose 会在 mongoose.models 和 mongoose.modelSchema 下面缓存你之前定义的模型,所需这种方法下面必须在清楚缓存的时候删除 mongoose 的缓存,自己感觉也不是很完美。
require
mongoose
Cannot overwrite model once compiled Mongoose
mongoose.models
mongoose.modelSchema
No branches or pull requests
按着你的思路正在实现一个 boilerplate,发现一些问题,nodemon 只是在监听 server 目录下的代码,但是 server 也承担着服务器渲染的工作,会用到 client 下的代码,所以说会出现下面的一些问题:
更新:
看了一下 README 提到了上面的问题,这个问题没有什么解决办法么?😑
The text was updated successfully, but these errors were encountered: