我有一个这样的工作区,其中'app'通常是firebase init
上的'functions'文件夹
server
--- app
------ controllers
------ middleware
------ db.js
------ index.js //where I export the firebase endpoint
------ router.js
------ serve.js //the express app
--- dist
--- node_modules
--- firebase.json
--- package.json
我从根目录运行firebase serve
以便在本地提供函数时没有问题,但是firebase deploy
要求我将package.json文件和./dist
文件夹放在{{1}中}}
有没有办法从root部署,而不在应用程序中放置package.json和app
文件夹?
我的package.json文件:
./dist
我的firebase.json文件
{
"main": "./dist/index.js",
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"prepare": "rm -rf dist && babel ./app/ -d ./dist && mkdir dist/private && cp app/private/conf.json dist/private/conf.json",
"lint": "eslint app",
"serve": "firebase serve --only dist",
"shell": "firebase experimental:functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only dist",
"logs": "firebase functions:log"
},
"dependencies": {
"cors": "^2.8.4",
"cross-fetch": "^2.1.0",
"firebase-admin": "^5.12.1",
"firebase-functions": "^1.0.3",
"moment": "^2.22.1",
"uuid": "^3.2.1"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-runtime": "^6.26.0",
"eslint": "^4.12.0",
"eslint-plugin-promise": "^3.6.0"
},
"private": true
}