Parcel 使用 worker 进程去启用多核编译。同时有文件系统缓存,即使在重启构建后也能快速再编译。
npm init创建package.json
npm install -g parcel-bundler
使用parcel打包一个网站,并运行查看效果test.js文件
let test = { a:1,b:2 }
module.exports = test;
import testObj from "./test.js";
console.log(testObj.a);
{
"name": "parcel",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "parcel test2.js"
},
"keywords": [],
"author": "",
"license": "ISC"
}