: 외부 패키지 연결하기 위한 설정.
: 구성이 없는 단순한 자동 번들링
npm install -D parcel-plugin-static-files-copy
"staticFiles":{
"staticPath": "static"
}
-static 폴더 만들고 favicon.ico 넣어주기
npm i -D postcss
npm i -D autoprefixer
postcss.config.js 수정하기
module.exports = {
plugins: [
require("autoprefixer")({
browsers: ["> 1%", "last 2 versions"],
}),
],
}
;
: ECMAScript 의 이전 버전을 이용해도 적용할 수 있도록하는 컴파일러.
@babel/core @bable/preset-env
설치
.babelrc.js 만들고
module.exports = {
presets: ["@babel/preset-env"],
};
: 기본값 비활성
parcel index.html --open
: 매우 꼼꼼한 구성
npm i -D webpack webpack-cli webpack-dev-server@next
"dev": "webpack-dev-server --mode development",
"build": "webpack --mode production"
path 결과물 반환 디렉토리 설정 ( 위치는 절대 위치로 )
webpack.config.js
// 절대경로 설정
const path = require("path");
module.exports = {
entry: "./js/main.js",
output: {
// path 는 절대 경로로 설정해야한다.
// 기본 설정.
// path: path.resolve(__dirname, "dist"),
// filename: "main.js",
clean: true,
},
};