강의

멘토링

커뮤니티

Inflearn Community Q&A

ohcho's profile image
ohcho

asked

Webpack for Frontend Developers

Webpack Getting Started Tutorial Part 5 - Webpack Configuration File Explanation

__dirname 질문입니당

Written on

·

676

1

선생님,

output:{
  fieldname : 'main.js',
  path: path.resolve( __dirname, 'dist')
}

여기에서요,

__dirname 대신에 fieldname 을 적어줘야 할 것 같은데 __dirname 를 적은 이유가 뭐에욤?

웹팩

Answer 2

2

captain님의 프로필 이미지
captain
Instructor

안녕하세요, __dirname은 Node.js의 속성입니다. 현재 모듈의 dir 이름을 반환해 주기 때문에 직접 타이핑 하실 필요가 없습니다. 아래 문서 참고하세요 :)

https://nodejs.org/docs/latest/api/modules.html#__dirname

Oh Chocho님의 프로필 이미지
Oh Chocho
Questioner

감사합니다!

0

👍

ohcho's profile image
ohcho

asked

Ask a question