Use route data for static site source of truth

Summary:
This removes the hard-coded route data from the Webpack config,
replacing it with the list of paths exported by the route data module.

Test Plan:
Note that the output of `yarn build` is identical before and after this
change: namely,

```shell
$ find build -exec shasum -a 256 {} + | shasum -a 256
7610a61f8a977f1d8edd849fc81256ca15f41f366e5fdb4b59a5d5ce37d6d58e
```

wchargin-branch: non-hard-coded-route-data
This commit is contained in:
William Chargin 2018-07-23 12:31:00 -07:00
parent 73e36b2ab2
commit 9a356f88a1
2 changed files with 2 additions and 1 deletions

View File

@ -40,6 +40,7 @@ module.exports = {
appHtml: resolveApp("src/app/public/index.html"),
appIndexJs: resolveApp("src/app/index.js"),
appServerSideRenderingIndexJs: resolveApp("src/app/server.js"),
appRouteData: resolveApp("src/app/routeData.js"),
appPackageJson: resolveApp("package.json"),
appSrc: resolveApp("src"),
yarnLockFile: resolveApp("yarn.lock"),

View File

@ -164,7 +164,7 @@ module.exports = {
plugins: [
new StaticSiteGeneratorPlugin({
entry: "ssr",
paths: /* TODO(@wchargin): Non-hard-coded routes */ ["/", "/explorer"],
paths: require(paths.appRouteData).routeData.map(({path}) => path),
locals: {},
}),
// Makes some environment variables available to the JS code, for example: