diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..1d338c1 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +node_modules +__build__ +dist + diff --git a/examples/_static/index.html b/examples/_static/index.html index c9c923a..6624075 100644 --- a/examples/_static/index.html +++ b/examples/_static/index.html @@ -10,8 +10,8 @@ -
  • SSR
  • +
  • Usage with multiple apps
  • +
  • SSR
  • Usage with vue-router
  • ', + { tag: 'link', rel: 'stylesheet', href: 'style.css' } + ], + otherNoscript: { + tag: 'noscript', + 'data-test': 'hello', + content: [ + '', + { tag: 'link', rel: 'stylesheet', href: 'style2.css' } + ] + }, + body: 'body-script1.js', + script: [ + ' + + + +

    Inspect Element to see the meta info

    + + ` +} + const router = createRouter({ history: createWebHistory('/vue-router'), routes: [ @@ -90,45 +139,27 @@ const router = createRouter({ ] }) -const Metadata = { - template: ` - - - - - - - - ` -} - -const App = { - template: ` - - My Title - - - - - -
    -

    vue-router

    - Home - About - - - -

    Inspect Element to see the meta info

    -
    - ` -} +const meta = createMeta({ + config: { + esi: { + group: true, + namespaced: true, + contentAttributes: [ + 'src', + 'test', + 'text' + ] + } + } +}) const app = createApp(App) -app.component('metainfo', Metadata) +app.component('metainfo', Metainfo) app.use(router) app.use(meta) +app.mount('#app') + +// old stuff: /* const { set, remove } = app.$meta().addApp('custom') @@ -142,8 +173,6 @@ set({ }) setTimeout(() => remove(), 3000) */ -app.mount('#app') - /* const waitFor = time => new Promise(r => setTimeout(r, time || 1000)) const o = { diff --git a/examples/vue-router/index.html b/examples/vue-router/index.html index 7d68002..0e28e69 100644 --- a/examples/vue-router/index.html +++ b/examples/vue-router/index.html @@ -14,6 +14,7 @@ ← Examples index
    +
    diff --git a/examples/webpack.config.js b/examples/webpack.config.js index b358c18..e8486fd 100644 --- a/examples/webpack.config.js +++ b/examples/webpack.config.js @@ -4,7 +4,7 @@ import webpack from 'webpack' import WebpackBar from 'webpackbar' import { VueLoaderPlugin } from 'vue-loader' -const srcDir = path.join(__dirname, '..', 'src') +// const srcDir = path.join(__dirname, '..', 'src') export default { devtool: 'inline-source-map', @@ -63,7 +63,7 @@ export default { // is a simple `export * from '@vue/runtime-dom`. However having this // extra re-export somehow causes webpack to always invalidate the module // on the first HMR update and causes the page to reload. - 'vue': 'vue/dist/vue.esm.js', + vue: 'vue/dist/vue.esm-bundler.js', 'vue-meta': path.resolve(__dirname, './next/') } }, diff --git a/package.json b/package.json index 60e29f2..c481399 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "dev": "cd examples && yarn dev && cd ..", "docs": "vuepress dev --host 0.0.0.0 --port 3000 docs", "docs:build": "vuepress build docs", - "lint": "eslint src test", + "lint": "eslint src test examples", "prerelease": "git checkout master && git pull -r", "release": "yarn lint && yarn test && standard-version", "test": "yarn test:unit && yarn test:e2e-ssr && yarn test:e2e-browser",