mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-24 16:55:24 +03:00
Adding version details to the PWA (#3606)
* Adding version details to the PWA * Created a coded version.js that can be loaded as a module. * Reverting, and simply identifying the permissible global vars for Vite * Update .eslintrc.js Removing whitespace * Update vite.config.js
This commit is contained in:
parent
16df95118a
commit
d6575e175f
3 changed files with 17 additions and 0 deletions
|
@ -4,6 +4,9 @@ import vue from "@vitejs/plugin-vue2";
|
|||
import path from "node:path";
|
||||
import { readFileSync } from "node:fs";
|
||||
import copy from "rollup-plugin-copy";
|
||||
import pkg from './package.json';
|
||||
|
||||
const childProcess = require('child_process');
|
||||
|
||||
function serveFileFromDirectory(directory) {
|
||||
return (req, res, next) => {
|
||||
|
@ -46,6 +49,11 @@ function serveLocalesPlugin() {
|
|||
}
|
||||
|
||||
export default defineConfig({
|
||||
define: {
|
||||
'__APP_VERSION__': JSON.stringify(pkg.version),
|
||||
'__APP_PRODUCTNAME__': JSON.stringify(pkg.productName),
|
||||
'__APP_REVISION__': JSON.stringify(childProcess.execSync("git rev-parse --short HEAD").toString().trim()),
|
||||
},
|
||||
test: {
|
||||
// NOTE: this is a replacement location for karma tests.
|
||||
// moving forward we should colocate tests with the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue