Conditional content in index.html
See original GitHub issueHello! It is possible in index.html
to include some content based on NODE_ENV
?
For example when I am in production
I want to include Google Analytics, or other services scripts.
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How To Conditionally Change index.html in React
Let's see how to make your index.html content depends on environment variables by using HtmlWebpackPlugin, which is included in Create React ...
Read more >How to add condition in index.html file in react js
I want to use the google tag manager script just for the signup page. I don't want them for other pages. How can...
Read more >How To Build HTML for Conditional Statements
This article will cover the use of conditional statements inside HTML blocks to control dynamic content in your emails.
Read more >Conditionally include a meta tag in index.html of a create-react ...
I have a tag I want in the staging version of my app. <meta name="robots" content="noindex" />. But I don't want it in...
Read more >Create React App, NPM Build, Add Conditional Content and ...
Create React App, NPM Build, Add Conditional Content and Production Scripts to Index.html. 12/20/2020 8:39:58 PM ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gaearon LOL, it works, great! Thanks! added this in
head
tagI think we might accidentally support ejs there although it wasn’t really intentional 😛 Let me know if you can make it work somehow.
In general though I find it might be easier to set this up from JS by appending script tags.