From 4e8ffa14771841c58f7ada0d17f6db03ae809129 Mon Sep 17 00:00:00 2001 From: likui <2218301630@qq.com> Date: Mon, 15 Jun 2020 10:46:53 +0800 Subject: [PATCH] fix: `decodeURIComponent` for module resolve 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 6e804a80748fe4..984287bf4ae586 100644 --- a/src/node/server/serverPluginModuleResolve.ts +++ b/src/node/server/serverPluginModuleResolve.ts @@ -26,7 +26,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) => {