mirror of
https://github.com/smartyellow/status.git
synced 2024-11-24 18:46:56 +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) => {
|
handler: async (req, res) => {
|
||||||
try {
|
try {
|
||||||
if (!renderedDashboard) {
|
if (!renderedDashboard) {
|
||||||
renderedDashboard = await buildDashboard({ server, settings });
|
renderedDashboard = await buildDashboard();
|
||||||
renderedDashboard.globalCss = await readFile(
|
renderedDashboard.globalCss = await readFile(
|
||||||
__dirname + '/gui/dashboard/app.css'
|
__dirname + '/gui/dashboard/app.css'
|
||||||
);
|
);
|
||||||
|
@ -1,18 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { minify: minifyCSS } = require('csso');
|
|
||||||
const { rollup } = require('rollup');
|
const { rollup } = require('rollup');
|
||||||
const commonjs = require('@rollup/plugin-commonjs');
|
const commonjs = require('@rollup/plugin-commonjs');
|
||||||
const css = require('rollup-plugin-css-only');
|
const css = require('rollup-plugin-css-only');
|
||||||
const replace = require('@rollup/plugin-replace');
|
|
||||||
const { default: resolve } = require('@rollup/plugin-node-resolve');
|
const { default: resolve } = require('@rollup/plugin-node-resolve');
|
||||||
const svelte = require('rollup-plugin-svelte');
|
const svelte = require('rollup-plugin-svelte');
|
||||||
const { terser } = require('rollup-plugin-terser');
|
const { terser } = require('rollup-plugin-terser');
|
||||||
|
|
||||||
async function build({ server, settings }) {
|
async function build() {
|
||||||
const serverDomain = server.settings.domain || 'localhost';
|
|
||||||
const serverPort = server.settings.port || 80;
|
|
||||||
const serverBase = `${serverDomain}:${serverPort}`;
|
|
||||||
let cssOutput = '';
|
let cssOutput = '';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -28,9 +23,7 @@ async function build({ server, settings }) {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
// Extract CSS
|
// Extract CSS
|
||||||
css({
|
css({ output: style => cssOutput = style }),
|
||||||
output: style => cssOutput = minifyCSS(style),
|
|
||||||
}),
|
|
||||||
|
|
||||||
// Resolve dependencies
|
// Resolve dependencies
|
||||||
resolve({
|
resolve({
|
||||||
@ -43,15 +36,6 @@ async function build({ server, settings }) {
|
|||||||
|
|
||||||
// Minify
|
// Minify
|
||||||
terser(),
|
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 {
|
return {
|
||||||
map: output[0].map ? output[0].map.toUrl() : '',
|
map: output[0].map ? output[0].map.toUrl() : '',
|
||||||
code: output[0].code,
|
code: output[0].code,
|
||||||
css: cssOutput.css,
|
css: cssOutput,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/smartyellow/status#readme",
|
"homepage": "https://github.com/smartyellow/status#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rollup/plugin-replace": "^4.0.0",
|
|
||||||
"csso": "^5.0.3",
|
|
||||||
"rollup-plugin-css-only": "^3.1.0"
|
"rollup-plugin-css-only": "^3.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user