Comments (4)
理论上应该可以通过proxy配置请求。
from dumi.
使用UMI配置可行
from dumi.
使用UMI配置可行
我在.umirc.ts 中配置proxy 还是没有成功
`import { defineConfig } from 'dumi';
const os = require("os");
const ifaces = os.networkInterfaces();
export const getHost = () => {
let host = '127.0.0.1';
let hasFound = false
for (const dev in ifaces) {
ifaces[dev].forEach(function(details) {
if(hasFound) return
if (details.family === 'IPv4' && details.address.indexOf('192.168') >= 0) {
host = details.address;
hasFound=true
}
});
}
return host;
};
export default defineConfig({
title: 'trialos-ui-common',
outputPath: 'docs-dist',
proxy: {
'/api': {
'target': 'http://xxx.test.com',
'changeOrigin': true,
'pathRewrite': { '^/$': '', },
cookieDomainRewrite: getHost(),
},
},
extraBabelPlugins: [
['babel-plugin-import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}],
],
});
`
你是怎么配置的?
from dumi.
请问这个问题为什么会关闭呀?最终怎么解决么?
proxy仅在dev生效呀,线上部署的doc怎么能用proxy呢?
from dumi.
Related Issues (20)
- code的src支持解析md文件么? HOT 1
- 根据官网创建项目,然后进行打包。本地打开打包的文件是空白 HOT 2
- Logo配置不生效
- 本地插件应该怎么使用 HOT 5
- API某个属性指定为引入别的类型后解析不出来数据
- 左侧目录导航 HOT 3
- sidebar 只对子路由有效么 HOT 1
- bug: 编写react组件demo,用到了react-router@5,code代码报错 HOT 3
- HTTPS会重定向到HTTP HOT 3
- dumi升级到2.0后,src中的import less报错了,应该如何修改呢? HOT 2
- umi1.0升级到umi2.0后, group取消了,url链接如何顺滑平移? HOT 1
- dumi 中 @ant-design/icons-svg/package.json 依赖包找不到 React 版本警告 HOT 5
- 配置postcss-loader不生效
- 配置postcss-loader,组件中引入xxx.pcss 不生效
- 组件中import './xxx/pcss'不生效,dumirc配置如下 HOT 6
- load typescript lib fail! HOT 3
- 如何在vue项目中引用 dumi 项目 build产物的组件?
- bug: Build 报错 HOT 5
- bug: dumi 2.0使用npx create-dumi初始化项目失败 HOT 23
- Unhandled Rejection (TypeError): Cannot read properties of undefined (reading '_updatedFibers') HOT 3
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 dumi.