rename env var WEBPACK_DEV_SERVER to WEB_BUILDER_DEV_SERVER (#57410)

This env var was already used when running either Webpack or esbuild. In the future Webpack will no longer be used, so a more general name not tied to the specific bundler is best.

(Command: `fastmod -e yaml,go,md WEBPACK_DEV_SERVER WEB_BUILDER_DEV_SERVER`)
This commit is contained in:
Quinn Slack 2023-10-06 08:57:12 -07:00 committed by GitHub
parent 1ce2734cf3
commit a61dc2775a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 11 deletions

View File

@ -91,7 +91,7 @@ type Common struct {
Manifest *assets.WebpackManifest
WebpackDevServer bool // whether the Webpack dev server is running (WEBPACK_DEV_SERVER env var)
WebpackDevServer bool // whether the Webpack dev server is running (WEB_BUILDER_DEV_SERVER env var)
// The fields below have zero values when not on a repo page.
Repo *types.Repo
@ -99,7 +99,7 @@ type Common struct {
api.CommitID // resolved SHA1 revision
}
var webpackDevServer, _ = strconv.ParseBool(os.Getenv("WEBPACK_DEV_SERVER"))
var webpackDevServer, _ = strconv.ParseBool(os.Getenv("WEB_BUILDER_DEV_SERVER"))
// repoShortName trims the first path element of the given repo name if it has
// at least two path components.

View File

@ -31,7 +31,7 @@ var (
versionCacheMu sync.RWMutex
versionCache = make(map[string]string)
_, noAssetVersionString = os.LookupEnv("WEBPACK_DEV_SERVER")
_, noAssetVersionString = os.LookupEnv("WEB_BUILDER_DEV_SERVER")
)
// Functions that are exposed to templates.

View File

@ -16,7 +16,7 @@ import (
func main() {
sanitycheck.Pass()
if os.Getenv("WEBPACK_DEV_SERVER") == "1" {
if os.Getenv("WEB_BUILDER_DEV_SERVER") == "1" {
assets.UseDevAssetsProvider()
}
svcmain.SingleServiceMainWithoutConf(shared.Service, svcmain.Config{}, svcmain.OutOfBandConfiguration{

View File

@ -42,7 +42,7 @@ var services = []service.Service{
func main() {
sanitycheck.Pass()
if os.Getenv("WEBPACK_DEV_SERVER") == "1" {
if os.Getenv("WEB_BUILDER_DEV_SERVER") == "1" {
assets.UseDevAssetsProvider()
}
osscmd.MainOSS(services, os.Args)

View File

@ -25,7 +25,7 @@ commands:
CONFIGURATION_MODE: server
USE_ENHANCED_LANGUAGE_DETECTION: false
# This needs to be set on `frontend` too so that `app.html` is rendered correctly
WEBPACK_DEV_SERVER: 1
WEB_BUILDER_DEV_SERVER: 1
watch:
- internal
- cmd/frontend
@ -76,7 +76,7 @@ commands:
cmd: ./node_modules/.bin/gulp --silent --color dev
install: pnpm install
env:
WEBPACK_DEV_SERVER: 1
WEB_BUILDER_DEV_SERVER: 1
NODE_ENV: development
NODE_OPTIONS: '--max_old_space_size=8192'

View File

@ -168,7 +168,7 @@ commands:
SITE_CONFIG_FILE: "../dev-private/enterprise/dev/site-config.json"
SITE_CONFIG_ESCAPE_HATCH_PATH: "$HOME/.sourcegraph/site-config.json"
# frontend processes need this to be so that the paths to the assets are rendered correctly
WEBPACK_DEV_SERVER: 1
WEB_BUILDER_DEV_SERVER: 1
watch:
- lib
- internal
@ -938,7 +938,7 @@ commands:
env:
SITE_CONFIG_FILE: "../dev-private/enterprise/dev/site-config.json"
SITE_CONFIG_ESCAPE_HATCH_PATH: "$HOME/.sourcegraph/site-config.json"
WEBPACK_DEV_SERVER: 1
WEB_BUILDER_DEV_SERVER: 1
watch:
- cmd
- enterprise
@ -990,7 +990,7 @@ bazelCommands:
SITE_CONFIG_FILE: "../dev-private/enterprise/dev/site-config.json"
SITE_CONFIG_ESCAPE_HATCH_PATH: "$HOME/.sourcegraph/site-config.json"
# frontend processes need this to be so that the paths to the assets are rendered correctly
WEBPACK_DEV_SERVER: 1
WEB_BUILDER_DEV_SERVER: 1
worker:
target: //cmd/worker
precmd: |

View File

@ -11,7 +11,7 @@
// And to support working with dev assets, with the webpack process handling them for you, you can use:
//
// func main() {
// if os.Getenv("WEBPACK_DEV_SERVER") == "1" {
// if os.Getenv("WEB_BUILDER_DEV_SERVER") == "1" {
// assets.UseDevAssetsProvider()
// }
// // ...