Comments (12)
可以讨论一下?
from rax-app.
我们参考create-react-app的方式在做吧
https://create-react-app.dev/docs/proxying-api-requests-in-development
from rax-app.
还有就是 devServer
这个有限属性透出是什么考虑。。
from rax-app.
先讨论一下吧,我是觉得参照create-react-app的用法比较合适。
既支持在配置中新增一个proxy参数来实现,同时还支持src/setupProxy.js
文件,因为代理这个情况比较复杂,纯配置的场景无法满足所有需求
from rax-app.
+1,通过配置在这个场景确实不太灵活�,直接用 http-proxy-middleware
可能更好,话说其它属性呢?
from rax-app.
这个配置中除了代理还有那些功能是缺失的?
from rax-app.
感觉还挺多的 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.
我们不应该把webpack-dev-server的所有功能都暴露给用户,那样的话用户就不需要我们了,直接自己配置webpack就完事了。
现在除了提供代理功能来解决跨域问题之外,还有哪些场景是用户痛点而目前的配置却是满足不了的?
from rax-app.
嗯,我看了一下 allowedHosts
https
可能是需要的
from rax-app.
OK,上班前正好有时间
from rax-app.
自己写了个代理插件,但是在单页下build-plugin-rax-app这个插件里,在before里拦截了 app.get,早早的就 res.send() 出去了,后面啥也干不了,只能重制 before 吗?
from rax-app.
重置 before 带来的问题是会丢掉服务启动等待时自动刷新页面的能力
from rax-app.
Related Issues (20)
- @babel/traverse 7.17.10 变更导致的问题 HOT 1
- .tsx 文件 sourceMap 失效 HOT 1
- 提供完善的 Rax 项目单元测试文档
- 自定义 docuemnt 在插件中注入 meta 标签异常 HOT 1
- Terser Plugin 在开启 webpack 5 后报错 HOT 1
- JSX To HTML 需要兼容标签闭合的情况
- 开启 keepalive 后,组件在路由跳转前重复执行了一次 useEffect HOT 1
- plugin-rax-compat-react 报错
- .mjs is not included with babel-loader HOT 2
- npm package `eslint-plugin-module`
- 优化 SSR 代码架构,用 ejs 替换现有 loader 渲染
- [Bug] tabHeader 未在 routes 中单独配置 path & source 时无法构建出 document
- [Bug] SSR 场景下,更新 Document 未触发 document 的重新构建 HOT 1
- [Bug] 构建时对不合理的对象属性类型声明报错
- [BUG] 3.8.x 版本在 windows 系统中 tabbar 渲染出错 HOT 1
- node 构建任务过滤所有 hot 相关代码注入
- "rax-app"”没有导出的成员“usePageShare” HOT 1
- [Feature] 各容器调试链接统一,根据请求头返回对应的内容
- [Feature] PHA 应用同时支持 tabBar 和 非 tabBar 页面
- [Bug] Windows11 系统下,有node-gyp @8.2.0 ,有[email protected] | win32 | x64,有Python3.10.1,有Microsoft Visual Studio\2019\BuildTools,却还是报错导致安装失败,这直接导致rax-app无法安装 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rax-app.