This commit is contained in:
Sacha Weatherstone
2022-02-07 00:00:55 +11:00
parent e43b04990b
commit 8d184578f0
109 changed files with 3495 additions and 3632 deletions
+14 -2
View File
@@ -1,5 +1,6 @@
import { execSync } from 'child_process';
import path from 'path';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';
import importToCDN from 'vite-plugin-cdn-import';
import EnvironmentPlugin from 'vite-plugin-environment';
@@ -7,11 +8,19 @@ import { VitePWA } from 'vite-plugin-pwa';
import react from '@vitejs/plugin-react';
let hash = '';
try {
hash = execSync('git rev-parse --short HEAD').toString().trim();
} catch (error) {
hash = 'DEVELOPMENT';
}
export default defineConfig({
plugins: [
react(),
EnvironmentPlugin({
COMMIT_HASH: execSync('git rev-parse --short HEAD').toString().trim(),
COMMIT_HASH: hash,
}),
importToCDN({
modules: [
@@ -36,7 +45,6 @@ export default defineConfig({
name: 'Meshtastic Web',
short_name: 'Meshtastic',
description: 'Meshtastic Web App',
// theme_color: '#2C2D3C',
theme_color: '#67ea94',
icons: [
{
@@ -65,6 +73,9 @@ export default defineConfig({
build: {
target: 'esnext',
assetsDir: '',
rollupOptions: {
plugins: [visualizer()],
},
},
resolve: {
alias: {
@@ -73,6 +84,7 @@ export default defineConfig({
'@components': path.resolve(__dirname, './src/components'),
'@hooks': path.resolve(__dirname, './src/hooks'),
'@core': path.resolve(__dirname, './src/core'),
'@skypack/': 'https://cdn.skypack.dev/',
},
},
});