mirror of
https://github.com/Lissy93/dashy.git
synced 2026-05-19 16:05:03 -04:00
🚨 Fixes DeepScan warning, fixes (hopefully) Netlify/Vercel deploy
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
# Environmental variables for build command
|
||||
[build.environment]
|
||||
NODE_VERSION = "20.11.1"
|
||||
NODE_OPTIONS = "--openssl-legacy-provider"
|
||||
|
||||
YARN_FLAGS = "--ignore-engines"
|
||||
|
||||
# Redirect the Node endpoints to serverless functions
|
||||
|
||||
@@ -90,9 +90,6 @@ export default {
|
||||
if (!shouldHide) {
|
||||
window.setTimeout(() => { this.shouldHide = shouldHide; }, this.timeDelay);
|
||||
window.addEventListener('keyup', this.keyPressEvent);
|
||||
} else { // Meh, component not needed.
|
||||
// No point wasting valuable bytes of your 32GB Ram, lets kill it
|
||||
this.$destroy();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ import { VitePWA } from 'vite-plugin-pwa';
|
||||
import svgLoader from 'vite-svg-loader';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { readFileSync } from 'fs';
|
||||
import { readFileSync, copyFileSync, existsSync, readdirSync } from 'fs';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const pkg = JSON.parse(readFileSync(path.resolve(__dirname, 'package.json'), 'utf-8'));
|
||||
@@ -31,11 +31,28 @@ function serveUserData() {
|
||||
};
|
||||
}
|
||||
|
||||
function copyUserDataConfig() {
|
||||
return {
|
||||
name: 'copy-user-data-config',
|
||||
closeBundle() {
|
||||
const outDir = path.resolve(__dirname, 'dist');
|
||||
if (!existsSync(userDataDir)) return;
|
||||
const ymlFiles = readdirSync(userDataDir).filter(f => f.endsWith('.yml') || f.endsWith('.yaml'));
|
||||
for (const file of ymlFiles) {
|
||||
const src = path.join(userDataDir, file);
|
||||
const dest = path.join(outDir, file);
|
||||
copyFileSync(src, dest);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
svgLoader(),
|
||||
serveUserData(),
|
||||
copyUserDataConfig(),
|
||||
VitePWA({
|
||||
registerType: 'prompt',
|
||||
manifest: {
|
||||
|
||||
Reference in New Issue
Block a user