diff --git a/package.json b/package.json index 174e38f..83f0d41 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@kne/modules-dev", - "version": "2.1.12", - "description": "用于辅助在项目内启动一个规范化组件开发的环境.", + "version": "2.1.13", + "description": "用于辅助在项目内启动一个规范化组件开发的环境", "publishConfig": { "access": "public", "source": "src/index.js", diff --git a/src/index.js b/src/index.js index 18a15bb..ef26019 100644 --- a/src/index.js +++ b/src/index.js @@ -50,15 +50,17 @@ const ExampleRoutes = ({ }) => { const componentsPath = paths.find((item) => item.key === 'components'); const componentsBaseUrl = ensureSlash(get(componentsPath, 'path', '/'), true); + const baseUrlPrefix = new RegExp(`^${ensureSlash(baseUrl,true)}`); + const componentsRoutePath = ensureSlash(componentsBaseUrl.replace(baseUrlPrefix, '')); return }> - {componentsPath && - }> - }/> - }/> - } + {componentsPath && }> + }/> + }/> + }