Quellcode durchsuchen

fix(build): cjs build failing due to `__VUE_PROD_DEVTOOLS__` defined (#1991) (#1992)

fix #1991 

Co-authored-by: Kia King Ishii <kia.king.08@gmail.com>
神楽坂みずき vor 4 Jahren
Ursprung
Commit
7151622d64
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 4 1
      rollup.config.js

+ 4 - 1
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) {