]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
build: esm-bunlder builds should be considered browser builds
authorEvan You <yyx990803@gmail.com>
Tue, 17 Dec 2019 22:34:10 +0000 (17:34 -0500)
committerEvan You <yyx990803@gmail.com>
Tue, 17 Dec 2019 22:34:10 +0000 (17:34 -0500)
packages/compiler-core/src/utils.ts
rollup.config.js

index 0c9223045205f9042ed0179006dc7e34d66094c3..69725085c0f28dc255c9d046951d97c10d3ae772 100644 (file)
@@ -60,7 +60,7 @@ let _parse: typeof parse
 let _walk: typeof walk
 
 export function loadDep(name: string) {
-  if (typeof process !== 'undefined' && isFunction(require)) {
+  if (!__BROWSER__ && typeof process !== 'undefined' && isFunction(require)) {
     return require(name)
   } else {
     // This is only used when we are building a dev-only build of the compiler
index 81971c33e4376f0534dbd3c22eebbfa1a42d95ed..b2a66d14bc57e46187957a091b50a1ad99112afc 100644 (file)
@@ -114,7 +114,7 @@ function createConfig(output, plugins = []) {
       createReplacePlugin(
         isProductionBuild,
         isBundlerESMBuild,
-        (isGlobalBuild || isRawESMBuild) &&
+        (isGlobalBuild || isRawESMBuild || isBundlerESMBuild) &&
           !packageOptions.enableNonBrowserBranches,
         isRuntimeCompileBuild
       ),