status/dashboard.js
Romein van Buren b265f5565a
Svelte dashboard foundation
Signed-off-by: Romein van Buren <romein@vburen.nl>
2022-07-08 13:48:51 +02:00

27 lines
658 B
JavaScript

'use strict';
const { build: viteBuild } = require('vite');
const { svelte } = require('@sveltejs/vite-plugin-svelte');
const fs = require('fs').promises;
const build = (prefix = '') => viteBuild({
root: __dirname + '/gui/dashboard',
base: `${prefix}/statusdashboard/asset/`,
plugins: [ svelte() ],
build: {
rollupOptions: {
output: {
assetFileNames: '[hash].[ext]',
entryFileNames: '[hash].js',
chunkFileNames: '[hash].js',
},
},
outDir: __dirname + '/gui/dashboard/build',
},
});
const cleanup = () => fs.rmdir(__dirname + '/gui/dashboard/build');
module.exports = { build, cleanup };
build();