mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-23 04:30:33 +03:00
fix: auto install plugin in browser
This commit is contained in:
@@ -85,6 +85,7 @@ function rollupConfig({
|
|||||||
// replaceConfig needs to have some values
|
// replaceConfig needs to have some values
|
||||||
'const polyfill = process.env.NODE_ENV === \'test\'': 'const polyfill = true',
|
'const polyfill = process.env.NODE_ENV === \'test\'': 'const polyfill = true',
|
||||||
'process.env.VERSION': `"${version}"`,
|
'process.env.VERSION': `"${version}"`,
|
||||||
|
'process.client' : isBrowserBuild ? 'true' : 'false',
|
||||||
'process.server' : isBrowserBuild ? 'false' : 'true',
|
'process.server' : isBrowserBuild ? 'false' : 'true',
|
||||||
/* remove unused stuff from deepmerge */
|
/* remove unused stuff from deepmerge */
|
||||||
// remove react stuff from is-mergeable-object
|
// remove react stuff from is-mergeable-object
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { setOptions } from './shared/options'
|
|||||||
import $meta from './shared/$meta'
|
import $meta from './shared/$meta'
|
||||||
import generate from './server/generate'
|
import generate from './server/generate'
|
||||||
import { hasMetaInfo } from './shared/meta-helpers'
|
import { hasMetaInfo } from './shared/meta-helpers'
|
||||||
|
import { isUndefined } from './utils/is-type'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin install function.
|
* Plugin install function.
|
||||||
@@ -25,6 +26,14 @@ function install (Vue, options) {
|
|||||||
Vue.mixin(createMixin(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 {
|
export default {
|
||||||
version,
|
version,
|
||||||
install,
|
install,
|
||||||
|
|||||||
Reference in New Issue
Block a user