### 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):tags/v0.13.0
| @@ -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, | |||
| @@ -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: { | |||
| @@ -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; | |||
| }, | |||
| @@ -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'; | |||