Removed some deps

This commit is contained in:
Romein van Buren 2022-07-13 11:03:27 +02:00
parent 7691085e8f
commit 434a34a2a8
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
3 changed files with 4 additions and 22 deletions

View File

@ -537,7 +537,7 @@ module.exports = {
handler: async (req, res) => {
try {
if (!renderedDashboard) {
renderedDashboard = await buildDashboard({ server, settings });
renderedDashboard = await buildDashboard();
renderedDashboard.globalCss = await readFile(
__dirname + '/gui/dashboard/app.css'
);

View File

@ -1,18 +1,13 @@
'use strict';
const { minify: minifyCSS } = require('csso');
const { rollup } = require('rollup');
const commonjs = require('@rollup/plugin-commonjs');
const css = require('rollup-plugin-css-only');
const replace = require('@rollup/plugin-replace');
const { default: resolve } = require('@rollup/plugin-node-resolve');
const svelte = require('rollup-plugin-svelte');
const { terser } = require('rollup-plugin-terser');
async function build({ server, settings }) {
const serverDomain = server.settings.domain || 'localhost';
const serverPort = server.settings.port || 80;
const serverBase = `${serverDomain}:${serverPort}`;
async function build() {
let cssOutput = '';
try {
@ -28,9 +23,7 @@ async function build({ server, settings }) {
}),
// Extract CSS
css({
output: style => cssOutput = minifyCSS(style),
}),
css({ output: style => cssOutput = style }),
// Resolve dependencies
resolve({
@ -43,15 +36,6 @@ async function build({ server, settings }) {
// Minify
terser(),
// Replace env vars
replace({
preventAssignment: false,
values: {
'__SERVER__': serverBase,
'__CLUSTERS__': JSON.stringify(settings.clusters),
},
}),
],
});
@ -65,7 +49,7 @@ async function build({ server, settings }) {
return {
map: output[0].map ? output[0].map.toUrl() : '',
code: output[0].code,
css: cssOutput.css,
css: cssOutput,
};
}
catch (error) {

View File

@ -17,8 +17,6 @@
},
"homepage": "https://github.com/smartyellow/status#readme",
"dependencies": {
"@rollup/plugin-replace": "^4.0.0",
"csso": "^5.0.3",
"rollup-plugin-css-only": "^3.1.0"
}
}