mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
webpack: Build a ZULIP_VERSION global constant into the built product.
This commit is contained in:
committed by
Tim Abbott
parent
73631950a5
commit
a8181152b7
@@ -3,11 +3,17 @@ import argparse
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from typing import NoReturn
|
||||
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
os.chdir(os.path.join(os.path.dirname(__file__), "../web"))
|
||||
|
||||
|
||||
from version import ZULIP_VERSION
|
||||
|
||||
|
||||
def build_for_prod_or_puppeteer(quiet: bool) -> NoReturn:
|
||||
"""Builds for production, writing the output to disk"""
|
||||
|
||||
@@ -15,7 +21,11 @@ def build_for_prod_or_puppeteer(quiet: bool) -> NoReturn:
|
||||
with open("/proc/meminfo") as meminfo:
|
||||
if int(next(meminfo).split()[1]) < 3 * 1024 * 1024:
|
||||
webpack_args += ["--max-old-space-size=1536"]
|
||||
webpack_args += ["../node_modules/.bin/webpack-cli", "--mode=production"]
|
||||
webpack_args += [
|
||||
"../node_modules/.bin/webpack-cli",
|
||||
"--mode=production",
|
||||
f"--env=ZULIP_VERSION={ZULIP_VERSION}",
|
||||
]
|
||||
if quiet:
|
||||
webpack_args += ["--stats=errors-only"]
|
||||
os.execvp(webpack_args[0], webpack_args)
|
||||
|
Reference in New Issue
Block a user