firebase-hostingfirebase-tools

absolute path in firebase.json hosting.public


How can I use an absolute path to store the content to deploy?

I tried next config, but does not work:

      "target": "site",
      "public": "/tmp/dist",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],

The error says: Error: Directory '/tmp/dist' for Hosting does not exist.

I can do ls /tmp/dist and the folder exists. In fact, if I create a link in the project ln -s /tmp/dist dist, the deployment works with no problem.

The project is a multi-site project, so looks like I can not use the -p parameter:

$ firebase deploy -p /tmp/dist --only hosting:site

Error: Cannot specify --public option with multi-site configuration.

Having trouble? Try firebase [command] --help

Solution

  • From a quick browse of the source code of the Firebase CLI the public path value is always handled through this:

    path.normalize(path.join(this.projectDir, pathName))
    

    Based on that it seems that you can only specify a relative path, not an absolute path.