chore(project): add vite init & update vite config with ts (#3519)

This commit is contained in:
Aex
2021-09-21 02:09:18 +08:00
committed by GitHub
parent 8a868a885c
commit 8acb9dc0eb
3 changed files with 10 additions and 1 deletions

View File

@@ -34,7 +34,7 @@
"docs:gen-locale": "rimraf docs/.vitepress/i18n && esno build/crowdin-generate.ts",
"docs:crowdin": "esno build/crowdin-credentials.ts",
"prepare": "husky install",
"postinstall": "yarn gen:version && cp play/play.example play/play.vue"
"postinstall": "yarn gen:version"
},
"config": {
"commitizen": {

View File

@@ -1,3 +1,4 @@
import './vite.init'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

8
play/vite.init.ts Normal file
View File

@@ -0,0 +1,8 @@
import { existsSync, writeFileSync, readFileSync } from 'fs'
const play = 'play.vue'
const example = 'play.example'
if (!existsSync(play)) {
writeFileSync(play, readFileSync(example))
}