Browse Source

build: drop compiler error emit code in browser production build

Evan You 6 years ago
parent
commit
fd470e0b1a
1 changed files with 7 additions and 1 deletions
  1. 7 1
      rollup.config.js

+ 7 - 1
rollup.config.js

@@ -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