WEBPACK
bundler 2 -WEBPACK
taehyeki
2021. 8. 31. 23:33
여러가지 파일을 웹팩을 통과시키면 단순한 형태의 파일로 만들어 지는 것을 보여주는 그림이다.
bundle 1에서 npx webpack --entry ~~ 와 같은 긴 형태의 명령어를 설정 하였지만
webpack.config.js 파일을 만들고
const path = require('path')
module.exports = {
entry: "./source/index.js",
output: {
path: path.resolve(__dirname, "public"),
filename:'index_bundle.js'
}
}
이렇게 설정 해주면 npx webpack 만 해줘도 실행이 가능하다.