build: use JS_BINARY__TARGET instead of BAZEL_BINDIR (#48795)

`BAZEL_BINDIR` is set for build targets only while `JS_BINARY__TARGET`
should be set for all js_binary & js_test targets for bazel build, test
& run contexts.
This commit is contained in:
Greg Magolan 2023-03-06 22:04:50 -08:00 committed by GitHub
parent b449de7b71
commit edf5013405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
const IS_BAZEL = !!(process.env.BAZEL_BINDIR || process.env.BAZEL_TEST)
const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_TEST)
const rootDir = IS_BAZEL ? process.cwd() : __dirname
module.exports = {

View File

@ -8,7 +8,7 @@ const path = require('path')
const logger = require('signale')
// TODO(bazel): drop when non-bazel removed.
if (!(process.env.BAZEL_BINDIR || process.env.BAZEL_TEST)) {
if (!(process.env.JS_BINARY__TARGET || process.env.BAZEL_TEST)) {
throw new Error(__filename + ' is only for use with Bazel')
}

View File

@ -3,7 +3,7 @@ import fs from 'fs'
import path from 'path'
// TODO(bazel): drop when non-bazel removed.
const IS_BAZEL = !!(process.env.BAZEL_BINDIR || process.env.BAZEL_TEST)
const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_TEST)
// NOTE: use fs.realpathSync() in addition to path.resolve() to resolve
// symlinks to the real path. This is required for webpack plugins using

View File

@ -5,7 +5,7 @@ import webpack from 'webpack'
import { ROOT_PATH } from '../paths'
// TODO(bazel): drop when non-bazel removed.
const IS_BAZEL = !!process.env.BAZEL_BINDIR
const IS_BAZEL = !!process.env.JS_BINARY__TARGET
interface CacheConfigOptions {
invalidateCacheFiles?: string[]

View File

@ -3,7 +3,7 @@
const path = require('path')
// TODO(bazel): drop when non-bazel removed.
const IS_BAZEL = !!(process.env.BAZEL_BINDIR || process.env.BAZEL_TEST)
const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_TEST)
const SRC_EXT = IS_BAZEL ? 'js' : 'ts'
const rootDir = IS_BAZEL ? process.cwd() : __dirname