diff --git a/build/build.js b/build/build.js index d8fc53c56..81e57abe0 100644 --- a/build/build.js +++ b/build/build.js @@ -66,6 +66,9 @@ function genConfig (opts) { flow(), node(), cjs(), + replace({ + __VERSION__: version + }), buble() ] } diff --git a/src/index.js b/src/index.js index efc6a463f..39458cb73 100644 --- a/src/index.js +++ b/src/index.js @@ -12,6 +12,7 @@ import { normalizeLocation } from './util/location' export default class VueRouter { static install: () => void; + static version: string; app: any; options: RouterOptions; @@ -155,6 +156,7 @@ function createHref (base: string, fullPath: string, mode) { } VueRouter.install = install +VueRouter.version = '__VERSION__' if (inBrowser && window.Vue) { window.Vue.use(VueRouter)