Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 03-pages > 02-api-reference > 03-next-config-js > env.mdx #346

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions docs/02-app/02-api-reference/05-next-config-js/env.mdx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
title: env
description: Learn to add and access environment variables in your Next.js application at build time.
title: 환경 변수
description: 빌드 시 Next.js 애플리케이션에서 환경 변수를 추가하고 액세스하는 방법을 알아보세요.
---

> Since the release of [Next.js 9.4](https://nextjs.org/blog/next-9-4) we now have a more intuitive and ergonomic experience for [adding environment variables](/docs/pages/building-your-application/configuring/environment-variables). Give it a try!
> [Next.js 9.4](https://nextjs.org/blog/next-9-4)의 출시 이후로 [환경 변수 추가하기](/docs/pages/building-your-application/configuring/environment-variables)가 더 직관적이고 사용하기 쉽습니다. 한번 시도해 보세요!

<details>
<summary>Examples</summary>
<summary>예제</summary>

- [With env](https://github.com/vercel/next.js/tree/canary/examples/with-env-from-next-config-js)
- [env 활용하기](https://github.com/vercel/next.js/tree/canary/examples/with-env-from-next-config-js)

</details>

> **Good to know**: environment variables specified in this way will **always** be included in the JavaScript bundle, prefixing the environment variable name with `NEXT_PUBLIC_` only has an effect when specifying them [through the environment or .env files](/docs/pages/building-your-application/configuring/environment-variables).
> **알아두면 좋은 사실**. 이런 방식으로 지정된 환경 변수들은 **항상** 자바스크립트 번들에 포함됩니다. 환경 변수 이름 앞에 `NEXT_PUBLIC_`를 붙이는 것은 그것들을 [환경 또는 .env 파일을 통해](/docs/pages/building-your-application/configuring/environment-variables) 지정할 때만 효과가 있습니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> **알아두면 좋은 사실**. 이런 방식으로 지정된 환경 변수들은 **항상** 자바스크립트 번들에 포함됩니다. 환경 변수 이름 앞에 `NEXT_PUBLIC_`를 붙이는 것은 그것들을 [환경 또는 .env 파일을 통해](/docs/pages/building-your-application/configuring/environment-variables) 지정할 때만 효과가 있습니다.
> **참고**: 이런 방식으로 지정된 환경 변수들은 **항상** 자바스크립트 번들에 포함됩니다. 환경 변수 이름 앞에 `NEXT_PUBLIC_`를 붙이는 것은 환경 변수들을 [환경 또는 .env 파일을 통해](/docs/pages/building-your-application/configuring/environment-variables) 지정할 때만 효과가 있습니다.


To add environment variables to the JavaScript bundle, open `next.config.js` and add the `env` config:
자바스크립트 번들에 환경 변수를 추가하려면 `next.config.js`를 열고 `env` 설정을 추가하세요.

```js filename="next.config.js"
module.exports = {
Expand All @@ -24,7 +24,7 @@ module.exports = {
}
```

Now you can access `process.env.customKey` in your code. For example:
이제 코드에서 `process.env.customKey`에 접근할 수 있습니다. 예시를 보세요.

```jsx
function Page() {
Expand All @@ -34,15 +34,15 @@ function Page() {
export default Page
```

Next.js will replace `process.env.customKey` with `'my-value'` at build time. Trying to destructure `process.env` variables won't work due to the nature of webpack [DefinePlugin](https://webpack.js.org/plugins/define-plugin/).
Next.js는 빌드 시에 `process.env.customKey``'my-value'`로 대체할 것입니다. webpack [DefinePlugin]https://webpack.js.org/plugins/define-plugin/)의 특성 때문에 `process.env` 변수를 구조 분해하는 것은 작동하지 않습니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Next.js는 빌드 시에 `process.env.customKey``'my-value'`로 대체할 것입니다. webpack [DefinePlugin]https://webpack.js.org/plugins/define-plugin/)의 특성 때문에 `process.env` 변수를 구조 분해하는 것은 작동하지 않습니다.
Next.js는 빌드 시에 `process.env.customKey``'my-value'`로 대체할 것입니다. 웹팩 [DefinePlugin](https://webpack.js.org/plugins/define-plugin/)의 특성 때문에 `process.env` 변수는 구조 분해할 수 없습니다.


For example, the following line:
예를 들어 다음과 같은 줄.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
예를 들어 다음과 같은 줄.
예를 들어 다음과 같은 줄은,


```jsx
return <h1>The value of customKey is: {process.env.customKey}</h1>
```

Will end up being:
다음과 같이 변환될 것입니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
다음과 같이 변환될 것입니다.
아래와 같이 변환될 것입니다.


```jsx
return <h1>The value of customKey is: {'my-value'}</h1>
Expand Down