Repository: ProjectEvergreen/greenwood (js)

Issue:
SPA prerenders by default when no _greenwood.config.js_ is present
## Type of Change
- [ ] New Feature Request
- [ ] Documentation / Website
- [ ] Improvement / Suggestion
- [x] Bug
- [ ] Other (please clarify below)

## Summary
If no _greenwood.config.js_ is present, SPA applications are now prerendering by default instead.  This appears to be a regression from introducing #874.

## Details
Basically because we always needed a _greenwood.config.js_ to enable `mode: 'spa'`, [the logic for setting `prenreder:false` for a SPA application was only done under that particular scenario](https://github.com/ProjectEvergreen/greenwood/blob/v0.23.0/packages/cli/src/lifecycles/config.js#L209).  But now, there is no mode to set, so no need for a config as the simplest SPA application only needs an _index.html_
```sh
src/
  index.html
```

And so in this case, there is logic to handle that.   Whoops.

Pull request description:
ensure SPA does not prerender by default
<!--
## Submitting a Pull Request
We love contributions and appreciate any help you can offer!
-->

## Related Issue
resolves #890 

## Summary of Changes
1. Handle SPA `prerender` setting when no _greenwood.config.js_ is present

Patch:
diff --git a/packages/cli/src/lifecycles/config.js b/packages/cli/src/lifecycles/config.js
index 1154fb44..36b357b7 100644
--- a/packages/cli/src/lifecycles/config.js
+++ b/packages/cli/src/lifecycles/config.js
@@ -218,6 +218,11 @@ const readAndMergeConfig = async() => {
             reject(`Error: greenwood.config.js staticRouter must be a boolean; true or false.  Passed value was typeof: ${typeof staticRouter}`);
           }
         }
+      } else {
+        // SPA should not prerender by default
+        if (fs.existsSync(path.join(customConfig.workspace, 'index.html'))) {
+          customConfig.prerender = false;
+        }
       }
 
       resolve({ ...defaultConfig, ...customConfig });


Test patch:
diff --git a/packages/cli/test/cases/build.default.spa/greenwood.config.js b/packages/cli/test/cases/build.default.spa/greenwood.config.js
deleted file mode 100644
index 639fd567..00000000
--- a/packages/cli/test/cases/build.default.spa/greenwood.config.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export default {
-  title: 'this is the wrong title'
-};
\ No newline at end of file