Cleanup correctly

Signed-off-by: Romein van Buren <romein@vburen.nl>
This commit is contained in:
Romein van Buren 2022-07-08 14:50:06 +02:00
parent b265f5565a
commit f29f962de4
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49

View File

@ -5,7 +5,7 @@ const { svelte } = require('@sveltejs/vite-plugin-svelte');
const fs = require('fs').promises;
const build = (prefix = '') => viteBuild({
root: __dirname + '/gui/dashboard',
root: __dirname + '/gui/dashboard/',
base: `${prefix}/statusdashboard/asset/`,
plugins: [ svelte() ],
build: {
@ -20,7 +20,10 @@ const build = (prefix = '') => viteBuild({
},
});
const cleanup = () => fs.rmdir(__dirname + '/gui/dashboard/build');
const cleanup = () => fs.rm(__dirname + '/gui/dashboard/build', {
recursive: true,
force: true,
});
module.exports = { build, cleanup };
build();