diff --git a/src/node/serverPluginVue.ts b/src/node/serverPluginVue.ts index e8772e870eee85..b3d4463f1c28ba 100644 --- a/src/node/serverPluginVue.ts +++ b/src/node/serverPluginVue.ts @@ -225,13 +225,14 @@ function compileSFCTemplate( filename: filePath, inMap: template.map, transformAssetUrls: { - // @ts-ignore base: path.posix.dirname(publicPath) }, compilerOptions: { scopeId: scoped ? `data-v-${hash_sum(publicPath)}` : null, runtimeModuleName: '/@modules/vue' - } + }, + preprocessLang: template.lang, + preprocessCustomRequire: (id: string) => require(resolve(root, id)) }) if (errors.length) {