쉽게말해 cli 에서 npm run build만 치면 "알아서 다 해줘" 가 가능해지기 위한 주문이다.
웹팩 메인페이지에 나와있는 기본값이다.
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
};
참고로 엔트리와 아웃풋의 모든 경로는 절대경로이지만 본인이 원하는 위치로 변경할 수 있다. 또 webpack.config.js 파일은 반드시 루트에 존재해야한다.
Can't resolve './src' in 'C:\Users\Desktop\Elice_Project1_Celev'
resolve './src' in 'C:\Users\Desktop\Elice_Project1_Celev'
using description file: C:\Users\Desktop\Elice_Project1_Celev\package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration
using description file: C:\Users\Desktop\Elice_Project1_Celev\package.json (relative path: ./src)
no extension
Field 'browser' doesn't contain a valid alias configuration