Closed
Description
Is this a bug report?
Yes
Did you try recovering your dependencies?
1.13.0
Which terms did you search for in User Guide?
Referencing Environment Variables in the HTML
Environment
Environment Info:
System:
OS: macOS 10.14.3
CPU: x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
Binaries:
Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
Yarn: 1.13.0 - ~/.nvm/versions/node/v10.15.3/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.15.3/bin/npm
Browsers:
Chrome: 72.0.3626.121
Firefox: 64.0
Safari: 12.0.3
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: 2.1.8
Steps to Reproduce
- Add the following to
index.html
file:
<meta name="NODE_ENV" content="%NODE_ENV%" />
<% if ("%NODE_ENV%" === "production") { %>
<script>
console.log('it works!');
</script>
<% } %>
yarn build
Expected Behavior
%NODE_ENV%
will be injected properly:
<meta name="NODE_ENV" content="production" />
<script>
console.log('it works!');
</script>
Actual Behavior
Script tag is missing:
<meta name="NODE_ENV" content="production" />
Metadata
Metadata
Assignees
Labels
No labels