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:
+2
-1
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
process.server = true
|
||||
|
||||
jest.useFakeTimers()
|
||||
jest.setTimeout(30000)
|
||||
|
||||
Reference in New Issue
Block a user