LoginSignup
0
1

More than 5 years have passed since last update.

Cloud Functionsでimport文を使う

Last updated at Posted at 2018-11-24
  • babel-cli babel-preset-es2015をdevDependenciesに追加する
yarn add --dev babel-cli babel-preset-es2015
  • .babelrcのファイルを作成しpresetの記述をする
{
  "presets": [
    [
      "es2015", {
        "targets": {
          "node": "current"
        }
      }
    ]
  ]
}
  • transpileをscriptsに追加する
package.json
 "main" : "ディレクトリ名"
 "scripts" :{
  "serve": "npm run transpile && firebase serve --only functions",
},
 "devDependencies": {
  "babel-cli": バージョン名,
  "babel-preset-es2025: バージョン名
}
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1