From 434a34a2a89addc137500f7e39094be89106264e Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Wed, 13 Jul 2022 11:03:27 +0200 Subject: [PATCH] Removed some deps --- index.js | 2 +- lib/dashboard/build.js | 22 +++------------------- package.json | 2 -- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/index.js b/index.js index a7b9220..9b29ce6 100644 --- a/index.js +++ b/index.js @@ -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' ); diff --git a/lib/dashboard/build.js b/lib/dashboard/build.js index a9d8313..d5cf555 100644 --- a/lib/dashboard/build.js +++ b/lib/dashboard/build.js @@ -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) { diff --git a/package.json b/package.json index 4f7c72d..df69a62 100644 --- a/package.json +++ b/package.json @@ -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" } }