Issue with require.js when adding web3.js to project

Clash Royale CLAN TAG#URR8PPPIssue with require.js when adding web3.js to project
following the getting started guide for web3.js. I've added the cdn link to my index.html however this results in the require.js error:
Uncaught TypeError: require.config is not a function
This error goes away if I remove the script. Could really use advice on how to proceed.
Here is the web3 stuff I have in index.html (In the debugger I see web3 loads before the require error is thrown).
<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js/dist/web3.min.js"></script>
<script>
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
// set the provider you want from Web3.providers
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
console.log(web3);
}
</script>
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.