build: avoid require call to consolidate in esm-browser build

This commit is contained in:
Evan You 2021-09-05 17:30:18 -04:00
parent fa5b583ba5
commit 12acf5102c

View File

@ -119,6 +119,8 @@ export function compileTemplate(
const preprocessor = preprocessLang
? preprocessCustomRequire
? preprocessCustomRequire(preprocessLang)
: __ESM_BROWSER__
? undefined
: require('consolidate')[preprocessLang as keyof typeof consolidate]
: false
if (preprocessor) {