Files
kino-app/frontend/craco.config.js
T
Myron Blair e27bb37f7b Rebrand StreamHoard, strip Emergent.sh platform artifacts
- Remove .emergent/ state dir, tracked .gitconfig, @emergentbase/visual-edits
  dep + craco wiring, emergent.sh script/meta tags, PostHog telemetry snippet
- Rename UI/docs branding Kino -> StreamHoard (README, DEPLOY.md, Navbar,
  Login, Register, AdminShowEpisodes, FastAPI title, health check response)
- Rename docker-compose container/network names to streamhoard-*
- Default admin email domain -> admin@streamhoard.local
2026-07-23 20:20:29 -05:00

81 lines
2.1 KiB
JavaScript

// craco.config.js
const path = require("path");
require("dotenv").config();
// Environment variable overrides
const config = {
enableHealthCheck: process.env.ENABLE_HEALTH_CHECK === "true",
};
// Conditionally load health check modules only if enabled
let WebpackHealthPlugin;
let setupHealthEndpoints;
let healthPluginInstance;
if (config.enableHealthCheck) {
WebpackHealthPlugin = require("./plugins/health-check/webpack-health-plugin");
setupHealthEndpoints = require("./plugins/health-check/health-endpoints");
healthPluginInstance = new WebpackHealthPlugin();
}
let webpackConfig = {
eslint: {
configure: {
extends: ["plugin:react-hooks/recommended"],
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
},
},
webpack: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
configure: (webpackConfig) => {
// Add ignored patterns to reduce watched directories
webpackConfig.watchOptions = {
...webpackConfig.watchOptions,
ignored: [
'**/node_modules/**',
'**/.git/**',
'**/build/**',
'**/dist/**',
'**/coverage/**',
'**/public/**',
],
};
// Add health check plugin to webpack if enabled
if (config.enableHealthCheck && healthPluginInstance) {
webpackConfig.plugins.push(healthPluginInstance);
}
return webpackConfig;
},
},
};
webpackConfig.devServer = (devServerConfig) => {
// Add health check endpoints if enabled
if (config.enableHealthCheck && setupHealthEndpoints && healthPluginInstance) {
const originalSetupMiddlewares = devServerConfig.setupMiddlewares;
devServerConfig.setupMiddlewares = (middlewares, devServer) => {
// Call original setup if exists
if (originalSetupMiddlewares) {
middlewares = originalSetupMiddlewares(middlewares, devServer);
}
// Setup health endpoints
setupHealthEndpoints(devServer, healthPluginInstance);
return middlewares;
};
}
return devServerConfig;
};
module.exports = webpackConfig;