🔨 write version.txt to dist
parent
c6e99c185d
commit
b333288309
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "@vue/tsconfig/tsconfig.node.json",
|
||||
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
|
||||
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*", "package.json"],
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"types": ["node"]
|
||||
|
|
|
|||
|
|
@ -1,15 +1,27 @@
|
|||
import { fileURLToPath, URL } from 'node:url'
|
||||
import { writeFileSync } from 'node:fs'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
import packageJson from './package.json'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
base: process.env.NODE_ENV === 'production'
|
||||
? '/openpose_editor/'
|
||||
: '/',
|
||||
plugins: [vue(), vueJsx()],
|
||||
plugins: [
|
||||
vue(),
|
||||
vueJsx(),
|
||||
{
|
||||
name: 'create-version-file',
|
||||
apply: 'build',
|
||||
writeBundle() {
|
||||
writeFileSync('dist/version.txt', packageJson.version);
|
||||
},
|
||||
}
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
|
|
|
|||
Loading…
Reference in New Issue