From 3523cd28aa44deff58f16078bf684ef03d356496 Mon Sep 17 00:00:00 2001
From: Brandon Clayton <bclayton@usgs.gov>
Date: Fri, 21 Jun 2024 10:17:46 -0600
Subject: [PATCH] Set base href to nshmp

---
 .vscode/launch.json                                   |  4 ++--
 angular.json                                          | 11 +++--------
 docs/development.md                                   |  6 +++---
 package.json                                          |  2 +-
 .../src/environments/scss-prod/environment.scss       |  1 -
 .../nshmp-apps/src/environments/scss/environment.scss |  1 -
 projects/nshmp-apps/src/styles/_uswds-theme.scss      |  3 +--
 7 files changed, 10 insertions(+), 18 deletions(-)
 delete mode 100644 projects/nshmp-apps/src/environments/scss-prod/environment.scss
 delete mode 100644 projects/nshmp-apps/src/environments/scss/environment.scss

diff --git a/.vscode/launch.json b/.vscode/launch.json
index 2a7ff155f..ca1d0905e 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -12,7 +12,7 @@
       "type": "msedge",
       "request": "launch",
       "name": "Debug with Edge",
-      "url": "http://localhost:4200",
+      "url": "http://localhost:4200/nshmp/",
       "preLaunchTask": "Start applications",
       "webRoot": "${workspaceFolder}"
     },
@@ -21,7 +21,7 @@
       "type": "chrome",
       "request": "launch",
       "name": "Debug with Chrome",
-      "url": "http://localhost:4200",
+      "url": "http://localhost:4200/nshmp/",
       "preLaunchTask": "Start applications",
       "webRoot": "${workspaceFolder}"
     }
diff --git a/angular.json b/angular.json
index 7202a70f6..c629ff3b0 100644
--- a/angular.json
+++ b/angular.json
@@ -17,6 +17,7 @@
         "build": {
           "builder": "@angular-devkit/build-angular:application",
           "options": {
+            "baseHref": "/nshmp/",
             "outputPath": {
               "base": "dist/nshmp-apps"
             },
@@ -88,18 +89,12 @@
           "configurations": {
             "development": {
               "stylePreprocessorOptions": {
-                "includePaths": [
-                  "projects/nshmp-apps/src/environments/scss",
-                  "node_modules"
-                ]
+                "includePaths": ["node_modules"]
               }
             },
             "production": {
               "stylePreprocessorOptions": {
-                "includePaths": [
-                  "projects/nshmp-apps/src/environments/scss-prod",
-                  "node_modules"
-                ]
+                "includePaths": ["node_modules"]
               },
               "fileReplacements": [
                 {
diff --git a/docs/development.md b/docs/development.md
index f419f3f0a..4a3a72903 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -71,7 +71,7 @@ For a development server, run:
 npm run start
 ```
 
-Applications run on <http://localhost:4200>.
+Applications run on <http://localhost:4200/nshmp/>.
 
 When running the development server any changes to the source code automatically will
 rebuild the application.
@@ -122,7 +122,7 @@ npm run build:prod
 npm run start:prod
 ```
 
-Applications run on <http://localhost:4200>.
+Applications run on <http://localhost:4200/nshmp/>.
 
 ### Context Path
 
@@ -134,7 +134,7 @@ npm run start:prod
 ```
 
 Where `some/path` is the new context path. <br>
-Applications would then run on <http://localhost:4200/some/path/>
+Applications would then run on <http://localhost:4200/nshmp/some/path/>
 
 <br>
 <div align="center">
diff --git a/package.json b/package.json
index 534dd34e6..cfed77f03 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "scripts": {
     "analyze": "npm run build:stats && webpack-bundle-analyzer dist/nshmp-apps/stats.json",
     "build": "ng build nshmp-apps",
-    "build:prod": "ng build nshmp-apps --configuration production --base-href /nshmp/",
+    "build:prod": "ng build nshmp-apps --configuration production",
     "build:stats": "npm run build:prod -- --stats-json",
     "compodoc": "compodoc",
     "compodoc:build": "bash scripts/build-docs.sh",
diff --git a/projects/nshmp-apps/src/environments/scss-prod/environment.scss b/projects/nshmp-apps/src/environments/scss-prod/environment.scss
deleted file mode 100644
index d6ebca784..000000000
--- a/projects/nshmp-apps/src/environments/scss-prod/environment.scss
+++ /dev/null
@@ -1 +0,0 @@
-$base-href: '/nshmp/';
diff --git a/projects/nshmp-apps/src/environments/scss/environment.scss b/projects/nshmp-apps/src/environments/scss/environment.scss
deleted file mode 100644
index 639ba1c2c..000000000
--- a/projects/nshmp-apps/src/environments/scss/environment.scss
+++ /dev/null
@@ -1 +0,0 @@
-$base-href: '/';
diff --git a/projects/nshmp-apps/src/styles/_uswds-theme.scss b/projects/nshmp-apps/src/styles/_uswds-theme.scss
index 58f6dddff..5079f5704 100644
--- a/projects/nshmp-apps/src/styles/_uswds-theme.scss
+++ b/projects/nshmp-apps/src/styles/_uswds-theme.scss
@@ -1,5 +1,4 @@
-@import 'environment.scss';
-
+$base-href: '/nshmp/';
 $theme-font-path: $base-href + 'assets/fonts';
 $theme-image-path: $base-href + 'assets/img';
 $theme-show-notifications: false;
-- 
GitLab