最近下载了一个tensorflowjs的一个demo研究的时候发现,该demo项目使用了parcel-bundler作为打包工具
package.json :
{
"name": "tfjs-examples-polynomial-regression-core",
"version": "0.1.0",
"description": "",
"main": "index.js",
"license": "Apache-2.0",
"private": true,
"engines": {
"node": ">=8.9.0"
},
"dependencies": {
"@tensorflow/tfjs": "^0.12.5",
"parcel-bundler": "^1.8.1",
"vega-embed": "^3.2.0",
"vega-lite": "^2.3.1"
},
"scripts": {
"watch": "cross-env NODE_ENV=development parcel index.html --no-hmr --open",
"build": "cross-env NODE_ENV=production parcel build index.html --no-minify --public-url ./",
"postinstall": "yarn upgrade --pattern @tensorflow"
},
"devDependencies": {
"babel-plugin-transform-runtime": "~6.23.0",
"babel-polyfill": "~6.26.0",
"babel-preset-env": "~1.6.1",
"clang-format": "~1.2.2",
"cross-env": "^5.1.6",
"parcel-bundler": "~1.8.1"
}
}
执行npm run watch 就开始打包项目,无需其他配置