/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v21.2.12
scripts/deploy-dev-app.js
48 строк
2 KB
Joey Perrott
build: update to bazel version 8.4.2 (#32490)
08 дек 2025, 21:10
Не верифицирован
08 дек 2025, 21:10
fa73b35
Код
Авторство
О чём код?
#!/usr/bin/env node /** * Script that builds the dev-app as a static web package that will be * deployed to the currently configured Firebase project. */ const {exec, set, cd, cp, rm, chmod} = require('shelljs'); const {join} = require('path'); // ShellJS should throw if any command fails. set('-e'); /** Path to the project directory. */ const projectDirPath = join(__dirname, '../'); // Go to project directory. cd(projectDirPath); // TODO: Remove --ignore_all_rc_files flag once a repository can be loaded in bazelrc during info // commands again. See https://github.com/bazelbuild/bazel/issues/25145 for more context. /** Path to the bazel-bin directory. */ const bazelBinPath = exec(`pnpm -s bazel --ignore_all_rc_files info bazel-bin`).stdout.trim(); /** Output path for the Bazel dev-app web package target. */ const webPackagePath = join(bazelBinPath, 'src/dev-app/web_package'); /** Destination path where the web package should be copied to. */ const distPath = join(projectDirPath, 'dist/dev-app-web-pkg'); // Build web package output. exec('pnpm -s bazel build //src/dev-app:web_package'); // Clear previous deployment artifacts. rm('-Rf', distPath); // Copy the web package from the bazel-bin directory to the project dist // path. This is necessary because the Firebase CLI does not support deployment // of a public folder outside of the "firebase.json" file. cp('-R', webPackagePath, distPath); // Bazel by default marks output files as `readonly` to ensure hermeticity. Since we moved // these files out of the `bazel-bin` directory, we should make them writable. This is necessary // so that subsequent runs of this script can delete old contents from the deployment dist folder. chmod('-R', 'u+w', distPath); // Run the Firebase CLI to deploy the hosting target. exec(`pnpm -s firebase deploy --only hosting`);