chore(docs): update head
This commit is contained in:
@@ -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,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -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))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user