๐ก Parcel vs Webpack
- Parcel : ๊ตฌ์ฑ ์๋ ๋จ์ํ ์๋ ๋ฒ๋ค๋ง, ์/์คํ ํ๋ก์ ํธ์ ์ ํฉ
- Webpack : ๊ผผ๊ผผํ ๊ตฌ์ฑ, ์ค/๋ํ ํ๋ก์ ํธ์ ์ ํฉ
๐ต Parcel
Parcel – The zero configuration build tool for the web.
Parcel combines a great out-of-the-box development experience with a scalable architecture that can take your project from just getting started to massive production application.
parceljs.org
- favicon ๋ง๋๋ ์ฌ์ดํธ
ICO Converter
Converts images to the ICO format for your websites or applications.
www.icoconverter.com
- static ํด๋๋ฅผ dist ํด๋๋ก ๋ณต์ฌํด์ ๋ถ์ฌ๋ฃ์ด์ค
npm i -D parcel-plugin-static-files-cp
package.json ํ์ผ์
"staticFiles": {
"staticPath: "static"
}
parcel-plugin-static-files-copy
ParcelJS plugin to copy static files from static dir to bundle directory.. Latest version: 2.6.0, last published: 2 years ago. Start using parcel-plugin-static-files-copy in your project by running `npm i parcel-plugin-static-files-copy`. There are 8 other
www.npmjs.com
* ๊ณต๊ธ ์ ์ฒด ์ ๋์ฌ (Vender Prefix)
- browserslist ์ต์ : ํ์ฌ NPM ํ๋ก์ ํธ์์ ์ง์ํ ๋ธ๋ผ์ฐ์ ์ ๋ฒ์๋ฅผ ๋ช ์ํ๋ ์ฉ๋
> ํด๋น ๋ช ์๋ฅผ Autoprefixer ํจํค์ง๊ฐ ํ์ฉํจ
> package.json ํ์ผ์ ์๋ ์ฝ์ (์ ์ธ๊ณ ์ ์ ์จ์ด 1%์ด์์ด๊ณ ํด๋นํ๋ ๋ธ๋ผ์ฐ์ ์ ๋ง์ง๋ง 2๊ฐ์ ๋ฒ์ ๊น์ง ์ง์ํ๋ค๋ ๋ป)
"browerslist": [
"> 1%",
"last 2 versions"
]
* ํ์ผ ์ด๋ฆ ๋ค์ rc(Runtime Configuration ์ฝ์ด)๊ฐ ๋ถ์ ํ์ผ์ ๊ตฌ์ฑ ํ์ผ ์๋ฏธํจ
๐ต Webpack
parcel๊ณผ ๋ฌ๋ฆฌ ์ง์ ๊ตฌ์ฑ์์ ์์ฑํด์ผํจ
webpack.config.js๋ ๋ธ๋ผ์ฐ์ ํ๊ฒฝ์ด ์๋ node.js ํ๊ฒฝ์์ ๋์ํจ
html์ด ์๋ ์๋ฐ์คํฌ๋ฆฝํธ ํ์ผ์ ์ง์ ์ ์ผ๋ก ์ค์ ํจ (์ง์ ์ ์ฌ๋ฌ ๊ฐ ์ค์ ๊ฐ๋ฅ)
Entry and Context | webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.
webpack.js.org