From e7a4979efeb4e0bbe46987ca795ef24196432730 Mon Sep 17 00:00:00 2001 From: zuofenghua <11100776@bbktel.com> Date: Fri, 29 Jan 2021 16:10:12 +0800 Subject: [PATCH] fix: no lang suffix file copy error --- package.json | 2 +- src/node/temporary/copy.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 82aa5c1..bc7fb47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vitepress-for-component", - "version": "0.11.9", + "version": "0.11.10", "description": "dumi like documentation tool", "main": "dist/node/index.js", "typings": "types/index.d.ts", diff --git a/src/node/temporary/copy.ts b/src/node/temporary/copy.ts index 61b6e45..a1d7e70 100644 --- a/src/node/temporary/copy.ts +++ b/src/node/temporary/copy.ts @@ -109,7 +109,7 @@ function tolocalePath(mapping: Record | null, path: string) { // en/ const langPrefix = mapping[lang.slice(1)] - if (!lang) { + if (!(lang.slice(1) in mapping)) { return path } return `${langPrefix}${path.slice(0, -(ext + lang).length)}${ext}`