2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-18 02:20:34 +03:00

feat: add possibility to add additional meta info

refactor: server injectors

feat: add head, bodyPrepend, bodyAppend injectors

refactor: create browserbuild through rollup replace (not separate entry)
This commit is contained in:
pimlie
2019-09-13 00:08:21 +02:00
committed by Pim
parent 0e49a9c43e
commit 0ab76ee16b
27 changed files with 389 additions and 387 deletions
+2 -1
View File
@@ -22,7 +22,8 @@ export function getVueMetaPath (browser) {
return path.resolve(__dirname, `../..${browser ? '/dist/vue-meta.js' : ''}`)
}
return path.resolve(__dirname, `../../src${browser ? '/browser' : ''}`)
process.server = !browser
return path.resolve(__dirname, `../../src`)
}
export function webpackRun (config) {
+4 -10
View File
@@ -2,28 +2,22 @@ import { JSDOM } from 'jsdom'
import { mount, shallowMount, createWrapper, createLocalVue } from '@vue/test-utils'
import { renderToString } from '@vue/server-test-utils'
import { defaultOptions } from '../../src/shared/constants'
import VueMetaBrowserPlugin from '../../src/browser'
import VueMetaServerPlugin from '../../src'
import VueMetaPlugin from '../../src'
export {
mount,
shallowMount,
createWrapper,
renderToString,
VueMetaBrowserPlugin,
VueMetaServerPlugin
VueMetaPlugin
}
export function getVue () {
return createLocalVue()
}
export function loadVueMetaPlugin (browser, options, localVue = getVue()) {
if (browser) {
localVue.use(VueMetaBrowserPlugin, Object.assign({}, defaultOptions, options))
} else {
localVue.use(VueMetaServerPlugin, Object.assign({}, defaultOptions, options))
}
export function loadVueMetaPlugin (options, localVue = getVue()) {
localVue.use(VueMetaPlugin, Object.assign({}, defaultOptions, options))
return localVue
}
+2
View File
@@ -1,2 +1,4 @@
process.server = true
jest.useFakeTimers()
jest.setTimeout(30000)