add env checks
This commit is contained in:
parent
71079e84ca
commit
eee1f5e403
@ -42,9 +42,9 @@ module.exports = {
|
||||
require("@rollup/plugin-commonjs")({
|
||||
sourceMap: false,
|
||||
}),
|
||||
require("rollup-plugin-terser").terser({
|
||||
output: {comments: false},
|
||||
}),
|
||||
// require("rollup-plugin-terser").terser({
|
||||
// output: {comments: false},
|
||||
// }),
|
||||
],
|
||||
};
|
||||
|
||||
|
13
updates.js
13
updates.js
@ -15,9 +15,16 @@ import {lstatSync, readFileSync, truncateSync, writeFileSync, accessSync} from "
|
||||
import {platform} from "os";
|
||||
import {version} from "./package.json";
|
||||
|
||||
const red = str => `\x1b[31m${str}\x1b[0m`;
|
||||
const green = str => `\x1b[32m${str}\x1b[0m`;
|
||||
const gray = str => `\x1b[90m${str}\x1b[0m`;
|
||||
let red, green, gray;
|
||||
if (!("NO_COLOR" in process.env) && ("FORCE_COLOR" in process.env || process.platform === "win32" || (stdout !== null && stdout.isTTY && env.TERM && env.TERM !== "dumb"))) {
|
||||
red = str => `\x1b[31m${str}\x1b[0m`;
|
||||
green = str => `\x1b[32m${str}\x1b[0m`;
|
||||
gray = str => `\x1b[90m${str}\x1b[0m`;
|
||||
} else {
|
||||
red = str => str;
|
||||
green = str => str;
|
||||
gray = str => str;
|
||||
}
|
||||
|
||||
env.NODE_ENV = "production";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user