From fd470e0b1ab438fc236dbd16f33635205f430e85 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 5 Feb 2020 14:21:09 -0500 Subject: [PATCH] build: drop compiler error emit code in browser production build --- rollup.config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 5d528bf9..2c34243e 100644 --- a/rollup.config.js +++ b/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