2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-05-17 03:09:36 +03:00

fix: auto install plugin in browser

This commit is contained in:
pimlie
2020-04-26 13:28:02 +02:00
parent fb89fc5f67
commit 32fdb2001a
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -85,6 +85,7 @@ function rollupConfig({
// replaceConfig needs to have some values
'const polyfill = process.env.NODE_ENV === \'test\'': 'const polyfill = true',
'process.env.VERSION': `"${version}"`,
'process.client' : isBrowserBuild ? 'true' : 'false',
'process.server' : isBrowserBuild ? 'false' : 'true',
/* remove unused stuff from deepmerge */
// remove react stuff from is-mergeable-object
+9
View File
@@ -5,6 +5,7 @@ import { setOptions } from './shared/options'
import $meta from './shared/$meta'
import generate from './server/generate'
import { hasMetaInfo } from './shared/meta-helpers'
import { isUndefined } from './utils/is-type'
/**
* Plugin install function.
@@ -25,6 +26,14 @@ function install (Vue, options) {
Vue.mixin(createMixin(Vue, options))
}
if (process.client) {
// automatic install
if (!isUndefined(window) && !isUndefined(window.Vue)) {
/* istanbul ignore next */
install(window.Vue)
}
}
export default {
version,
install,