]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
build: drop compiler error emit code in browser production build
authorEvan You <yyx990803@gmail.com>
Wed, 5 Feb 2020 19:21:09 +0000 (14:21 -0500)
committerEvan You <yyx990803@gmail.com>
Wed, 5 Feb 2020 19:21:09 +0000 (14:21 -0500)
rollup.config.js

index 5d528bf904b08b1b4375eef9a6a97893fca8b45f..2c34243edaf67fb4a5fe46a8ef2abe1d39ef88ec 100644 (file)
@@ -177,7 +177,13 @@ function createReplacePlugin(
     // support options?
     // the lean build drops options related code with buildOptions.lean: true
     __FEATURE_OPTIONS__: !packageOptions.lean && !process.env.LEAN,
-    __FEATURE_SUSPENSE__: true
+    __FEATURE_SUSPENSE__: true,
+    ...(isProduction && isBrowserBuild
+      ? {
+          'context.onError(': `/*#__PURE__*/ context.onError(`,
+          'emitError(': `/*#__PURE__*/ emitError(`
+        }
+      : {})
   }
   // allow inline overrides like
   //__RUNTIME_COMPILE__=true yarn build runtime-core