From 7151622d646968686546f1c4c80f7575c9b99176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E6=A5=BD=E5=9D=82=E3=81=BF=E3=81=9A=E3=81=8D?= <45122329+CokeMine@users.noreply.github.com> Date: Tue, 1 Jun 2021 23:29:32 +0800 Subject: [PATCH] fix(build): cjs build failing due to `__VUE_PROD_DEVTOOLS__` defined (#1991) (#1992) fix #1991 Co-authored-by: Kia King Ishii --- rollup.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 1ff829389..30b9df0bb 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -27,6 +27,7 @@ function createEntries() { function createEntry(config) { const isGlobalBuild = config.format === 'iife' const isBundlerBuild = config.format !== 'iife' && !config.browser + const isBundlerESMBuild = config.format === 'es' && !config.browser const c = { external: ['vue'], @@ -61,7 +62,9 @@ function createEntry(config) { __DEV__: isBundlerBuild ? `(process.env.NODE_ENV !== 'production')` : config.env !== 'production', - __VUE_PROD_DEVTOOLS__: isBundlerBuild ? '__VUE_PROD_DEVTOOLS__' : 'false' + __VUE_PROD_DEVTOOLS__: isBundlerESMBuild + ? '__VUE_PROD_DEVTOOLS__' + : 'false' })) if (config.transpile !== false) {