]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
fix: webpack build with d.ts
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 31 Jan 2020 18:21:26 +0000 (19:21 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 31 Jan 2020 18:21:26 +0000 (19:21 +0100)
src/index.ts
src/navigationGuards.ts
webpack.config.js

index 94cd1dbea1965dc44026733ea878608dd4196063..4721e2504dda2836924d8eab9cc313e94a5cd8d0 100644 (file)
@@ -11,6 +11,9 @@ import {
 } from './types'
 import { onBeforeRouteLeave } from './navigationGuards'
 
+// necessary for webpack
+///<reference path="global.d.ts"/>
+
 declare module 'vue' {
   function inject<T>(key: InjectionKey<T> | string): T | undefined
   function inject<T>(key: InjectionKey<T> | string, defaultValue: T): T
index 623bf899a58eca668a82468778b4986e209c7476..1846428b58a2b07be78b949b31c243c590d811ac 100644 (file)
@@ -2,9 +2,6 @@ import { NavigationGuard } from './types'
 import { inject, getCurrentInstance, warn } from 'vue'
 import { matchedRouteKey } from './components/View'
 
-// TODO: why is this necessary if it's in global.d.ts, included in tsconfig.json
-declare var __DEV__: boolean
-
 export function onBeforeRouteLeave(leaveGuard: NavigationGuard) {
   const instance = getCurrentInstance()
   if (!instance) {
index d9dc64e5911b2c902121d710994b186def091596..660c5295d0650a6ffda25bf40994e4347014def4 100644 (file)
@@ -45,7 +45,7 @@ const config = (env = {}) => ({
       vue: '@vue/runtime-dom',
     },
     // Add `.ts` and `.tsx` as a resolvable extension.
-    extensions: ['.ts', '.tsx', '.js', '.vue'],
+    extensions: ['.ts', 'd.ts', '.tsx', '.js', '.vue'],
   },
   plugins: [
     new VueLoaderPlugin(),