From: Evan You Date: Wed, 5 Feb 2020 19:21:09 +0000 (-0500) Subject: build: drop compiler error emit code in browser production build X-Git-Tag: v3.0.0-alpha.5~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd470e0b1ab438fc236dbd16f33635205f430e85;p=thirdparty%2Fvuejs%2Fcore.git build: drop compiler error emit code in browser production build --- diff --git a/rollup.config.js b/rollup.config.js index 5d528bf904..2c34243eda 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