mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 14:51:44 +00:00
build: still need BAZEL_BINDIR for webpack_bundle custom rule (#48796)
Actually, webpack_bundle doesn't have JS_BINARY__TARGET set since it is
a custom build rule.... To handle all the cases I think we have to check
for both. 😞
This commit is contained in:
parent
47218d030c
commit
7f4e6da8cc
@ -1,4 +1,4 @@
|
||||
const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_TEST)
|
||||
const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_BINDIR || process.env.BAZEL_TEST)
|
||||
const rootDir = IS_BAZEL ? process.cwd() : __dirname
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -8,7 +8,7 @@ const path = require('path')
|
||||
const logger = require('signale')
|
||||
|
||||
// TODO(bazel): drop when non-bazel removed.
|
||||
if (!(process.env.JS_BINARY__TARGET || process.env.BAZEL_TEST)) {
|
||||
if (!(process.env.JS_BINARY__TARGET || process.env.BAZEL_BINDIR || process.env.BAZEL_TEST)) {
|
||||
throw new Error(__filename + ' is only for use with Bazel')
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
// TODO(bazel): drop when non-bazel removed.
|
||||
const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_TEST)
|
||||
const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_BINDIR || 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
|
||||
|
||||
@ -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.JS_BINARY__TARGET
|
||||
const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_BINDIR)
|
||||
|
||||
interface CacheConfigOptions {
|
||||
invalidateCacheFiles?: string[]
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
const path = require('path')
|
||||
|
||||
// TODO(bazel): drop when non-bazel removed.
|
||||
const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_TEST)
|
||||
const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_BINDIR || process.env.BAZEL_TEST)
|
||||
const SRC_EXT = IS_BAZEL ? 'js' : 'ts'
|
||||
const rootDir = IS_BAZEL ? process.cwd() : __dirname
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user