Javascript 모듈화 specification(명세)로 CommonJS와 AMD:Async Module Definition가 있다

그리고 Webpack은 이 둘을 모두 지원하는 Javascript의 모듈화 시스템이다


필자의 주변에서는 CommonJS가 더 많이 쓰이는 것 같다. Node에서도 CommonJS를 사용하고.

아래 Naver D2 참고 사이트에서도 CommonJS로 Webpack 예제를 보여준다 (더 간결하다는 이유로)


<참고>

JavaScript 모듈화 도구, webpack: http://d2.naver.com/helloworld/0239818


JavaScript 표준을 위한 움직임: CommonJS와 AMD: http://d2.naver.com/helloworld/12864

요약: Server-side는 CommonJS 간결, Client-side는 AMD가 더 유연



WRITTEN BY
hojongs
블로그 옮겼습니다 https://hojongs.github.io/