6.2.2
OSX
$ firebase init
๊ธฐ๋ฅ๊ณผ ํธ์คํ ๋ชจ๋์ ๋ํ ๊ตฌ์ฑ์ ์ ํํฉ๋๋ค. ๊ทธ๋ฐ ๋ค์ TSLint๋ฅผ ์ ๋ ฅํ๊ณ yes๋ฅผ ์ ๋ ฅํฉ๋๋ค.
์๋ ๋ณต์ฌ ๋ถ์ฌ๋ฃ๊ธฐ๋ฅผ functions/src/index.ts์ ๋ณต์ฌํ์ญ์์ค.
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
admin.initializeApp();
// Most basic HTTP Funtion
export const basicHTTP = functions.https.onRequest((request, response) => {
const name = request.query.name;
if (!name) {
response.status(400).send('ERROR you must supply a name :(');
}
response.send(`hello ${name}`);
});
$ firebase deploy --only functions
์ ํํ Firebase ํ๋ก์ ํธ์ ํจ์๊ฐ ์ฑ๊ณต์ ์ผ๋ก ๋ฐฐํฌ๋๊ธฐ๋ฅผ ๊ธฐ๋ํฉ๋๋ค.
"๋ฐฐํฌํ ๋์์ ์ดํดํ ์ ์์ต๋๋ค. --only ๋๋ --except ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ ์ ํจํ ๋์์ ์ง์ ํ๋์ง ํ์ธํ์ญ์์ค. ๊ทธ๋ ์ง ์์ผ๋ฉด firebase.json์ ํ์ธํ์ฌ ํ๋ก์ ํธ๊ฐ ์ํ๋ ๊ธฐ๋ฅ์ ๋ํด ์ด๊ธฐํ๋์๋์ง ํ์ธํ์ญ์์ค. ."
๋๋ ๊ทธ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ง๋ง ์ด์ ๋ฐฐํฌํ๋ ค๊ณ ํ ๋ ์ด๊ฒ์ ๋ฐ์ต๋๋ค.
../node_modules/@types/cordova/index.d.ts(35,58): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(36,52): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(37,53): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(38,57): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(39,57): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(40,59): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(41,62): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(42,60): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(43,63): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(44,61): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(46,61): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(47,55): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(48,56): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(49,60): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(50,60): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(51,62): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(52,65): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(53,63): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(54,66): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(55,64): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(57,51): error TS2304: Cannot find name 'Event'.
../node_modules/@types/cordova/index.d.ts(58,54): error TS2304: Cannot find name 'Event'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
์ด๊ฒ์ด TSLint์ ๊ด๋ จ์ด ์์ต๋๊น?
๋๋ ์ถ๊ฐํ๋ค
"files": [
"node_modules/typescript/lib/lib.es6.d.ts"
],
"exclude": [
"node_modules"
]
ํจ์์์ ๋ด tsconfig ํ์ผ์ ์ถ๊ฐํ๊ณ ํธ๋ฆญ์ ์ํํ๋ ๊ฒ์ฒ๋ผ ๋ณด์์ต๋๋ค. ๊ด์ฐฎ์ผ๋ฉด ์๋ ค์ฃผ์ธ์.
๊ทธ๊ฒ ์ ๋ฌธ์ ์ธ์ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ํด๊ฒฐํ์ จ๋ค๋ ๋คํ์ ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋๋ ์ถ๊ฐํ๋ค
ํจ์์์ ๋ด tsconfig ํ์ผ์ ์ถ๊ฐํ๊ณ ํธ๋ฆญ์ ์ํํ๋ ๊ฒ์ฒ๋ผ ๋ณด์์ต๋๋ค. ๊ด์ฐฎ์ผ๋ฉด ์๋ ค์ฃผ์ธ์.