mirror of
https://github.com/smartyellow/status.git
synced 2024-11-21 15:18:55 +01:00
Removed some deps
This commit is contained in:
parent
7691085e8f
commit
434a34a2a8
2
index.js
2
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'
|
||||
);
|
||||
|
@ -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) {
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user