From 91f696b2b9120c0559f53e00469a0b79d67fb034 Mon Sep 17 00:00:00 2001 From: underfin <2218301630@qq.com> Date: Fri, 19 Jun 2020 05:35:20 +0800 Subject: [PATCH] fix: `decodeURIComponent` for module resolve (#393) fix #392 --- src/node/server/serverPluginModuleResolve.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/server/serverPluginModuleResolve.ts b/src/node/server/serverPluginModuleResolve.ts index 9689f4ae830d24..eb923283834931 100644 --- a/src/node/server/serverPluginModuleResolve.ts +++ b/src/node/server/serverPluginModuleResolve.ts @@ -27,7 +27,8 @@ export const moduleResolvePlugin: ServerPlugin = ({ root, app, resolver }) => { return next() } - const id = ctx.path.replace(moduleRE, '') + // path maybe contain encode chars + const id = decodeURIComponent(ctx.path.replace(moduleRE, '')) ctx.type = 'js' const serve = async (id: string, file: string, type: string) => {