Git Product home page Git Product logo

Comments (12)

SoloJiang avatar SoloJiang commented on May 18, 2024

可以讨论一下?

from rax-app.

andycall avatar andycall commented on May 18, 2024

我们参考create-react-app的方式在做吧
https://create-react-app.dev/docs/proxying-api-requests-in-development

from rax-app.

SoloJiang avatar SoloJiang commented on May 18, 2024

还有就是 devServer 这个有限属性透出是什么考虑。。

from rax-app.

andycall avatar andycall commented on May 18, 2024

先讨论一下吧,我是觉得参照create-react-app的用法比较合适。
既支持在配置中新增一个proxy参数来实现,同时还支持src/setupProxy.js文件,因为代理这个情况比较复杂,纯配置的场景无法满足所有需求

from rax-app.

SoloJiang avatar SoloJiang commented on May 18, 2024

+1,通过配置在这个场景确实不太灵活�,直接用 http-proxy-middleware 可能更好,话说其它属性呢?

from rax-app.

andycall avatar andycall commented on May 18, 2024

这个配置中除了代理还有那些功能是缺失的?

from rax-app.

SoloJiang avatar SoloJiang commented on May 18, 2024

感觉还挺多的 https://webpack.docschina.org/configuration/dev-server/#devserver-progress-%E5%8F%AA%E7%94%A8%E4%BA%8E%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%B7%A5%E5%85%B7-cli-,有些在 json 里配置不了,可能有些字段可能需要评估是否必要了。。

from rax-app.

andycall avatar andycall commented on May 18, 2024

我们不应该把webpack-dev-server的所有功能都暴露给用户,那样的话用户就不需要我们了,直接自己配置webpack就完事了。
现在除了提供代理功能来解决跨域问题之外,还有哪些场景是用户痛点而目前的配置却是满足不了的?

from rax-app.

SoloJiang avatar SoloJiang commented on May 18, 2024

嗯,我看了一下 allowedHosts https 可能是需要的

from rax-app.

andycall avatar andycall commented on May 18, 2024

OK,上班前正好有时间

from rax-app.

cxcshuaige avatar cxcshuaige commented on May 18, 2024

自己写了个代理插件,但是在单页下build-plugin-rax-app这个插件里,在before里拦截了 app.get,早早的就 res.send() 出去了,后面啥也干不了,只能重制 before 吗?

from rax-app.

yacheng avatar yacheng commented on May 18, 2024

重置 before 带来的问题是会丢掉服务启动等待时自动刷新页面的能力

from rax-app.

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.