mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-22 12:27:19 +00:00

Co-authored-by: Paulus Schoutsen <balloob@gmail.com> Co-authored-by: Thomas Lovén <thomasloven@gmail.com> Co-authored-by: Zack Barett <arnett.zackary@gmail.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Philip Allgaier <mail@spacegaier.de> Co-authored-by: Yosi Levy <37745463+yosilevy@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: Patrick ZAJDA <patrick@zajda.fr> Co-authored-by: Steve Repsher <steverep@users.noreply.github.com>
37 lines
840 B
JavaScript
37 lines
840 B
JavaScript
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
const paths = require("./paths.js");
|
|
|
|
module.exports = {
|
|
useRollup() {
|
|
return process.env.ROLLUP === "1";
|
|
},
|
|
useWDS() {
|
|
return process.env.WDS === "1";
|
|
},
|
|
isProdBuild() {
|
|
return (
|
|
process.env.NODE_ENV === "production" || module.exports.isStatsBuild()
|
|
);
|
|
},
|
|
isStatsBuild() {
|
|
return process.env.STATS === "1";
|
|
},
|
|
isTest() {
|
|
return process.env.IS_TEST === "true";
|
|
},
|
|
isNetlify() {
|
|
return process.env.NETLIFY === "true";
|
|
},
|
|
version() {
|
|
const version = fs
|
|
.readFileSync(path.resolve(paths.polymer_dir, "setup.cfg"), "utf8")
|
|
.match(/version\W+=\W(\d{8}\.\d)/);
|
|
if (!version) {
|
|
throw Error("Version not found");
|
|
}
|
|
return version[1];
|
|
},
|
|
};
|