build: pre-shim process in browser build of compiler-sfc

This commit is contained in:
Evan You 2021-09-05 17:19:49 -04:00
parent 815bfcffae
commit 2217993897

View File

@ -230,6 +230,15 @@ function createReplacePlugin(
// is targeting Node (SSR)? // is targeting Node (SSR)?
__NODE_JS__: isNodeBuild, __NODE_JS__: isNodeBuild,
// for compiler-sfc browser build inlined deps
...(isBrowserESMBuild
? {
'process.env': '({})',
'process.platform': '""',
'process.stdout': 'null'
}
: {}),
// 2.x compat build // 2.x compat build
__COMPAT__: isCompatBuild, __COMPAT__: isCompatBuild,