Code Monkey home page Code Monkey logo

Comments (2)

chikara-chan avatar chikara-chan commented on May 22, 2024

这个问题我也是研究了很久,目前无法解决,即使可以解决,服务端重启再打包会比较耗时,所以也没必要解决

from react-isomorphic-boilerplate.

zhuscat avatar zhuscat commented on May 22, 2024

@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.modelsmongoose.modelSchema 下面缓存你之前定义的模型,所需这种方法下面必须在清楚缓存的时候删除 mongoose 的缓存,自己感觉也不是很完美。

from react-isomorphic-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.