chore(docs): update head

This commit is contained in:
braks
2024-01-29 21:56:44 +01:00
committed by Braks
parent e24f436fc5
commit 64a2091ddb
2 changed files with 8 additions and 17 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ export default [
{ {
hid: 'og:image', hid: 'og:image',
property: 'og:image', property: 'og:image',
content: `http://${meta.img}`, content: meta.img,
}, },
], ],
[ [
@@ -36,7 +36,7 @@ export default [
{ {
hid: 'og:image:secure_url', hid: 'og:image:secure_url',
property: 'og:image:secure_url', property: 'og:image:secure_url',
content: `https://${meta.img}`, content: meta.img,
}, },
], ],
[ [
+6 -15
View File
@@ -2,7 +2,9 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs'
import { resolve } from 'node:path' import { resolve } from 'node:path'
import type { Plugin } from 'vite' import type { Plugin } from 'vite'
function getPkgPath(pkgName: string, fileName) { type Emit = (file: { type: 'asset'; fileName: string; filePath: string; source: string }) => void
function getPkgPath(pkgName: string, fileName: string) {
return resolve(__dirname, `../../../node_modules/@vue-flow/${pkgName}/dist/${fileName}`) return resolve(__dirname, `../../../node_modules/@vue-flow/${pkgName}/dist/${fileName}`)
} }
@@ -10,7 +12,7 @@ function getPublicPath(fileName: string) {
return resolve(__dirname, `../../public/${fileName}`) return resolve(__dirname, `../../public/${fileName}`)
} }
function copyFiles(emit: any) { function copyFiles(emit: Emit) {
;['core', 'background', 'controls', 'minimap', 'node-resizer', 'node-toolbar'].forEach((name) => { ;['core', 'background', 'controls', 'minimap', 'node-resizer', 'node-toolbar'].forEach((name) => {
const fileName = `vue-flow-${name}.mjs` const fileName = `vue-flow-${name}.mjs`
@@ -35,18 +37,7 @@ export function copyVueFlowPlugin(): Plugin {
name: 'copy-vue-flow', name: 'copy-vue-flow',
buildStart() { buildStart() {
// use fs to copy files // use fs to copy files
copyFiles((file: any) => { copyFiles((file) => {
// remove existing files
if (existsSync(getPublicPath(file.fileName))) {
writeFileSync(getPublicPath(file.fileName), '')
}
writeFileSync(getPublicPath(file.fileName), file.source)
})
},
watchChange() {
// use fs to copy files
copyFiles((file: any) => {
// remove existing files // remove existing files
if (existsSync(getPublicPath(file.fileName))) { if (existsSync(getPublicPath(file.fileName))) {
writeFileSync(getPublicPath(file.fileName), '') writeFileSync(getPublicPath(file.fileName), '')
@@ -56,7 +47,7 @@ export function copyVueFlowPlugin(): Plugin {
}) })
}, },
generateBundle() { generateBundle() {
copyFiles((file: any) => this.emitFile(file)) copyFiles((file) => this.emitFile(file))
}, },
} }
} }