diff --git a/app/.eleventy.js b/app/.eleventy.js
index 2f4732487a..bb5510e861 100644
--- a/app/.eleventy.js
+++ b/app/.eleventy.js
@@ -71,6 +71,7 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy({
"src/img": "assets/img",
+ "src/js": "src/js",
"site/img": "assets/img",
"site/_includes/css": "css",
"site/_includes/js": "assets/js",
@@ -88,7 +89,7 @@ module.exports = function (eleventyConfig) {
"stroke-width": 2,
})
- const pathPrefix = process.env.NODE_ENV === "production" ? "/metrics" : ""
+ const pathPrefix = process.env.NODE_ENV.includes("production") ? "/metrics" : ""
return {
dir: {
diff --git a/app/package.json b/app/package.json
index 843e4eb742..cacb07c4dc 100644
--- a/app/package.json
+++ b/app/package.json
@@ -8,6 +8,11 @@
"start:eleventy": "eleventy --serve",
"start:rollup": "rollup --config rollup.config.mjs -w",
"start:postcss": "postcss ./src/css -d ./site/_includes/css -w",
+ "prod": "NODE_ENV=test-production run-s -l prod:*",
+ "prod:clean": "rm -rf dist",
+ "prod:rollup": "rollup --config rollup.config.mjs --bundleConfigAsCjs",
+ "prod:postcss": "postcss ./src/css -d ./site/_includes/css",
+ "prod:eleventy": "eleventy --serve",
"build": "NODE_ENV=production run-s -l build:*",
"build:clean": "rm -rf dist",
"build:rollup": "rollup --config rollup.config.mjs --bundleConfigAsCjs",
diff --git a/app/postcss.config.js b/app/postcss.config.js
index 0173ea5fee..81de268979 100644
--- a/app/postcss.config.js
+++ b/app/postcss.config.js
@@ -2,7 +2,7 @@ module.exports = {
plugins: [
require("postcss-import"),
require("autoprefixer"),
- ...(process.env.NODE_ENV === "production"
+ ...(process.env.NODE_ENV.includes("production")
? [
require("cssnano"),
require("@fullhuman/postcss-purgecss")({
diff --git a/app/rollup.config.mjs b/app/rollup.config.mjs
index 05b7f3c529..627beb0670 100644
--- a/app/rollup.config.mjs
+++ b/app/rollup.config.mjs
@@ -14,7 +14,7 @@ export default [
resolve(),
babel(),
commonjs(),
- ...(process.env.NODE_ENV === "production" ? [terser()] : []),
+ ...(process.env.NODE_ENV.includes("production") ? [terser()] : []),
],
},
]
diff --git a/app/site/_data/projects.js b/app/site/_data/projects.js
index fcf5651d3b..dbded66961 100644
--- a/app/site/_data/projects.js
+++ b/app/site/_data/projects.js
@@ -3,10 +3,10 @@ const path = require("path");
module.exports = function () {
const dataDirectory = path.join(__dirname);
- var projects = [];
+ const projects = [];
// Read the list of organization directories
- var orgDirectories = fs.readdirSync(dataDirectory);
+ const orgDirectories = fs.readdirSync(dataDirectory);
// Iterate through organization directories
orgDirectories.forEach((orgDirectory) => {
@@ -37,7 +37,8 @@ module.exports = function () {
}
});
}
+
});
-
- return projects;
+
+ return projects
};
diff --git a/app/site/_data/site.js b/app/site/_data/site.js
index dc94bb5e9e..5d74e4ba3f 100644
--- a/app/site/_data/site.js
+++ b/app/site/_data/site.js
@@ -1,9 +1,10 @@
-const production = process.env.NODE_ENV === "production"
+const isProduction = process.env.NODE_ENV.includes("production")
+const isTest = process.env.NODE_ENV.includes("test")
-const host = production ? "https://dsacms.github.io" : "http://0.0.0.0:8080"
+const host = (isProduction && !isTest) ? "https://dsacms.github.io" : "http://localhost:8080"
// For modifying the