在我们新建一个vue工程后(vue create xxxx),会有以下信息:
67 packages are looking for funding
run `npm fund` for details
进入 xxx 目录后,运行npm fund 会有以下信息:
随便打开一下https://opencollective.com/core-js 就会看到这个是来众筹的。
据说vue作者尤大大,每年可众筹20W 美元,不用上班了。。。
那么如果你的项目中用到了一些库,感觉这个库不错,想邀请更多人对这个库进行支持,那么可以用这个库opencollective-postinstall 来邀请。这个库的说明如下:
Lightweight npm postinstall message to invite people to donate to your collective
使用方法如下:
1)npm i --save -dev opencollective-postinstall
2)在package.json中配置如下:
{
"name": "open-collective-demo",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"postinstall": "opencollective-postinstall"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"opencollective-postinstall": "^2.0.3",
"vue-template-compiler": "^2.6.11"
},
"collective": {
"url": "https://opencollective.com/webpack" //这个就是你要邀请众筹的项目
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
3)运行npm run postinstall 就会看到众筹信息了