Browse Source

tsconfig.json required

master
pvincent 4 years ago
parent
commit
9ffe504586
  1. 3
      .vscode/settings.json
  2. 54
      vite.config.ts

3
.vscode/settings.json

@ -5,6 +5,7 @@
"vetur.validation.interpolation": true, "vetur.validation.interpolation": true,
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode",
"cSpell.enableFiletypes": ["markdown", "!typescript", "!json"], "cSpell.enableFiletypes": ["markdown", "!typescript", "!json"],
"cSpell.words": [ "cSpell.words": [
"Astrologia", "Astrologia",
@ -16,5 +17,5 @@
"protovue", "protovue",
"tmik", "tmik",
"windi" "windi"
] ]
} }

54
vite.config.ts

@ -5,40 +5,40 @@ import WindiCSS from 'vite-plugin-windicss'
import { resolve } from "path" import { resolve } from "path"
export default { export default {
plugins: [ plugins: [
vue(), vue(),
WindiCSS() WindiCSS()
], ],
define: { define: {
APP_TITLE: JSON.stringify(pkg.name), APP_TITLE: JSON.stringify(pkg.name),
APP_VERSION: JSON.stringify(buildVersion()), APP_VERSION: JSON.stringify(buildVersion()),
APP_REPOSITORY: JSON.stringify(pkg.repository), APP_REPOSITORY: JSON.stringify(pkg.repository),
APP_LICENSE: JSON.stringify(pkg.license), APP_LICENSE: JSON.stringify(pkg.license),
}, },
resolve: { resolve: {
alias: { alias: {
"@": resolve(__dirname, "src"), "@": resolve(__dirname, "src"),
}, },
}, },
} }
// FUNCTIONS // FUNCTIONS
//---------- //----------
function buildVersion(): string { function buildVersion(): string {
const version = pkg.version const version = pkg.version
if (!isGitCommand()) { if (!isGitCommand()) {
return version return version
} }
const dirty = Number(execSync("git status -s | wc -l").toString()) const dirty = Number(execSync("git status -s | wc -l").toString())
return dirty > 0 ? `${version}${dirty}` : version return dirty > 0 ? `${version}${dirty}` : version
} }
function isGitCommand(): boolean { function isGitCommand(): boolean {
try { try {
execSync("command -v git") execSync("command -v git")
return true return true
} catch (e) { } catch (e) {
return false return false
} }
} }
|||||||
100:0
Loading…
Cancel
Save