]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor: use custom size check
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 18 Sep 2020 16:53:31 +0000 (18:53 +0200)
committerEduardo San Martin Morote <posva@users.noreply.github.com>
Wed, 4 Nov 2020 21:19:57 +0000 (22:19 +0100)
rollup.config.js
src/router.ts
yarn.lock

index d4f14c8c328059d16049939c5884c53596201201..49086fd15b46fe5413f18e2565d89c1b901907b4 100644 (file)
@@ -64,7 +64,10 @@ function createConfig(format, output, plugins = []) {
   output.sourcemap = !!process.env.SOURCE_MAP
   output.banner = banner
   output.externalLiveBindings = false
-  output.globals = { vue: 'Vue', '@vue/devtools-api': 'VueDevtoolsApi' }
+  output.globals = {
+    vue: 'Vue',
+    '@vue/devtools-api': 'VueDevtoolsApi',
+  }
 
   const isProductionBuild = /\.prod\.js$/.test(output.file)
   const isGlobalBuild = format === 'global'
@@ -94,7 +97,10 @@ function createConfig(format, output, plugins = []) {
   // during a single build.
   hasTSChecked = true
 
-  const external = ['vue', '@vue/devtools-api']
+  const external = [
+    'vue',
+    // '@vue/devtools-api',
+  ]
 
   const nodePlugins = [resolve(), commonjs()]
 
index 9b64f09b2115a244a65f52725ddd243b834362b4..7d5cc326aa15f923acbca772db86ebee299987ab 100644 (file)
@@ -1105,7 +1105,7 @@ export function createRouter(options: RouterOptions): Router {
         unmountApp.call(this, arguments)
       }
 
-      if (__DEV__ && __BROWSER__) {
+      if ((__DEV__ || __FEATURE_PROD_DEVTOOLS__) && __BROWSER__) {
         addDevtools(app, router, matcher)
       }
     },
index 3b2333ddaf4e8bb8f2d3419ba31e0552f9a36676..3a29677c568eb9aa49029269bbfad3a996098223 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
     "@vue/compiler-dom" "3.0.2"
     "@vue/shared" "3.0.2"
 
+"@vue/devtools-api@^6.0.0-beta.2":
+  version "6.0.0-beta.2"
+  resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.0.0-beta.2.tgz#833ad3335f97ae9439e26247d97f9baf7b5a6116"
+  integrity sha512-5k0A8ffjNNukOiceImBdx1e3W5Jbpwqsu7xYHiZVu9mn4rYxFztIt+Q25mOHm7nwvDnMHrE7u5KtY2zmd+81GA==
+
 "@vue/reactivity@3.0.2":
   version "3.0.2"
   resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.0.2.tgz#42ed5af6025b494a5e69b05169fcddf04eebfe77"