New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deploy for CRA2 #155
Comments
This seems to be a problem with CRA2 and there's a bunch of bug reports around it. There is allegedly a workaround (though I haven't tried it yet): |
This does seem to work:
Happy to open a PR if this is an acceptable stop-gap. |
I'm not sure its a bug as such. Its an intentional and documented change in behaviour, but its a change in behaviour which is problematic for some use cases (including ours). But yes please - do submit a PR. I've not really put any thought into this beyond working out how to un-break prod and writing this up to come back to it. Reading that thread, if we can use that workaround that allows us to build a single file, that sounds ideal. I'd still like to set up a staging environment to test with though, so may sit open for a bit until I get a chance to do that. |
Currently the deploy script is broken.
The reason for this is that with
react-scripts
1.x, runningnpm run build
would spit out a single file:Then in
deploy.sh
we'd pick that file out and upload it to S3 aswdiv.js
.From
react-scripts
2.x, runningnpm run build
now spits out multiple files:but our deploy script was only uploading one of them.
This was pretty much impossible to pick up locally. I only noticed it when I deployed to production and and broke everything (side note: it has clearly been ages since I last deployed this 😳 ) . As a quick fix, I downgraded to
react-scripts == 1.1.5
locally, ran a build locally and pushed that up to S3. That gets us a non-broken deploy onwidget.wheredoivote.co.uk
but the repo as it stands will currently break production if we try to deploy.Fixing this is high priority.
Next steps:
react-scripts
in order to get it to build down to a single file?<script type="text/javascript" src="https://widget.wheredoivote.co.uk/wdiv.js"></script>
in their website now, I really want to find a way ensure that stays working 🤞 )deploy.sh
as appropriateThe text was updated successfully, but these errors were encountered: