<aside> ❗ JS, HTML, CSS, 이미지 파일들을 브라우저에서 사용할 수 있도록 하나의 JS 파일(번들)로 합쳐서 코드를 최적화 시켜주는 번들러이다.
</aside>
// babel 설치
npm i -D @babel/core @babel/preset-env
// async, await 키워드를 사용하기 위한 패키지 설치
npm i -D @babel/plugin-transform-runtime
// .babelrc.js (babel 설정 파일)
module.exports = {
presets: ['@babel/preset-env'],
plugins: [
['@babel/plugin-transform-runtime']
]
}
// package.json
"browserslist": [
"> 1%",
"last 2 versions"
]
npm i -D webpack webpack-cli webpack-dev-server@next
"scripts": {
"dev": "webpack-dev-server --mode development",
"build": "webpack --mode production"
}