PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, August 20, 2022

[FIXED] What is "inlining" means in Next.js "env" document?

 August 20, 2022     environment-variables, next.js, production-environment     No comments   

Issue

I'm searching of 'env' concept at static build file in Next.js but can't understand what is "inlining" meaning in this context. Could someone give me more specific example?

This loads process.env.NEXT_PUBLIC_ANALYTICS_ID into the Node.js environment automatically, allowing you to use it anywhere in your code. The value will be inlined into JavaScript sent to the browser because of the NEXT_PUBLIC_ prefix. This inlining occurs at build time, so your various NEXT_PUBLIC_ envs need to be set when the project is built.

https://nextjs.org/docs/basic-features/environment-variables#exposing-environment-variables-to-the-browser


Solution

It means that when the build tool generates the source code to send to the browser, it will replace the instruction to read an an environment variable with a string representing the value of that environment variable at the time the build happened.



Answered By - Quentin
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing