ckingbailey / dam

Visualizating reliance on and fragility of dams in California
1 stars 3 forks source link

path to main.js cannot be found in production env #23

Closed ckingbailey closed 6 years ago

ckingbailey commented 6 years ago

createReactApp builds index.html to have the path to main.js be absolute, referencing the document root by starting the path with '/'

We deploy to a route called /damss on the domain dam-safety.github.io. Currently the way CRA builds our project, index.html looks at the base url, dam-safety.github.io/main.js for the main.js asset. We need it to look to dam-safety.github.io/damss/main.js.

I read in the comments in the CRA webpack config that we can set our homepage to '.' in packagon.json and the build script will then build relative paths

ckingbailey commented 6 years ago

resolved by #24