Skip to content

Instantly share code, notes, and snippets.

@yann-yinn
Last active June 22, 2018 14:44
Show Gist options
  • Save yann-yinn/3edd22d5558b2a7f25cc6e4bfb3362f7 to your computer and use it in GitHub Desktop.
Save yann-yinn/3edd22d5558b2a7f25cc6e4bfb3362f7 to your computer and use it in GitHub Desktop.
create-react-app raven 3 - do not send report in development mode
<!-- /public/index.html -->
<% if (process.env.NODE_ENV == 'production') { %>
<script src="https://cdn.ravenjs.com/3.26.2/raven.min.js" crossorigin="anonymous"></script>
<script>Raven.config('https://[email protected]/1230983', {
environment: "%NODE_ENV%",
}).install();
</script>
<% } %>
@Keirua
Copy link

Keirua commented Jun 22, 2018

l.5 I guess you already know the environment since you are inside the 'production' branch of the if

@yann-yinn
Copy link
Author

@Keirua yep, i know that NODE_ENV will be "production" once code is built

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment