Преглед изворни кода

feat: Configure the root directory alias #1739 (#2875)

### What problem does this PR solve?

feat: Configure the root directory alias #1739

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
tags/v0.13.0
balibabu пре 1 година
родитељ
комит
bedb05012d
No account linked to committer's email address

+ 2
- 1
web/.umirc.ts Прегледај датотеку

@@ -1,3 +1,4 @@
import path from 'path';
import { defineConfig } from 'umi';
import { appName } from './src/conf.json';
import routes from './src/routes';
@@ -5,7 +6,7 @@ import routes from './src/routes';
export default defineConfig({
title: appName,
outputPath: 'dist',
// alias: { '@': './src' },
alias: { root: path.resolve('../') },
npmClient: 'npm',
base: '/',
routes,

+ 2
- 1
web/src/components/api-service/chat-overview-modal/api-content.tsx Прегледај датотеку

@@ -1,7 +1,8 @@
import HightLightMarkdown from '@/components/highlight-markdown';
import { useSetModalState, useTranslate } from '@/hooks/common-hooks';
import { Button, Card, Flex, Space } from 'antd';
import apiDoc from '../../../../../docs/references/api.md';
// import apiDoc from '../../../../../api/http_api.md';
import apiDoc from 'root/api/http_api.md';
import ChatApiKeyModal from '../chat-api-key-modal';
import EmbedModal from '../embed-modal';
import { usePreviewChat, useShowEmbedModal } from '../hooks';

+ 3
- 3
web/src/components/highlight-markdown/index.less Прегледај датотеку

@@ -4,9 +4,9 @@
li {
padding: 4px 0px;
}
p {
white-space: pre-wrap; // https://stackoverflow.com/questions/60332183/new-line-with-react-markdown
}
// p {
// white-space: pre-wrap; // https://stackoverflow.com/questions/60332183/new-line-with-react-markdown
// }
}

.code {

+ 1
- 0
web/tsconfig.json Прегледај датотеку

@@ -1,4 +1,5 @@
{
"extends": "./src/.umi/tsconfig.json",
"@@/*": ["src/.umi/*"],
"root": ["../*"],
}

Loading…
Откажи
Сачувај