Skip to content

Commit

Permalink
feat: Load markdown file with "asset/source" infiniflow#1739 (infinif…
Browse files Browse the repository at this point in the history
…low#2880)

### What problem does this PR solve?

feat: Load markdown file with "asset/source" #17339

### 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):
  • Loading branch information
cike8899 authored Oct 17, 2024
1 parent 46e40c4 commit e3f72b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions web/.umirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import routes from './src/routes';
export default defineConfig({
title: appName,
outputPath: 'dist',
alias: { root: path.resolve('../') },
alias: { '@parent': path.resolve(__dirname, '../') },
npmClient: 'npm',
base: '/',
routes,
Expand All @@ -26,9 +26,6 @@ export default defineConfig({
hack: `true; @import "~@/less/index.less";`,
},
},
mdx: {
loader: 'remark-loader',
},
devtool: 'source-map',
copy: ['src/conf.json'],
proxy: {
Expand All @@ -41,14 +38,7 @@ export default defineConfig({
},
},
chainWebpack(memo, args) {
memo.module
.rule('markdown')
.test(/\.md$/)
.use('html-loader')
.loader('html-loader')
.end()
.use('remark-loader')
.loader('remark-loader');
memo.module.rule('markdown').test(/\.md$/).type('asset/source');

return memo;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import HightLightMarkdown from '@/components/highlight-markdown';
import { useSetModalState, useTranslate } from '@/hooks/common-hooks';
import { Button, Card, Flex, Space } from 'antd';
// import apiDoc from '../../../../../api/http_api.md';
import apiDoc from 'root/api/http_api.md';
import apiDoc from '@parent/api/http_api.md';
import ChatApiKeyModal from '../chat-api-key-modal';
import EmbedModal from '../embed-modal';
import { usePreviewChat, useShowEmbedModal } from '../hooks';
Expand Down

0 comments on commit e3f72b0

Please sign in to comment.