Parcourir la source

fix: Run build command only in bench build

version-14
Faris Ansari il y a 4 ans
Parent
révision
41d9bc64e1
2 fichiers modifiés avec 9 ajouts et 1 suppressions
  1. +7
    -1
      esbuild/esbuild.js
  2. +2
    -0
      frappe/build.py

+ 7
- 1
esbuild/esbuild.js Voir le fichier

@@ -47,6 +47,10 @@ let argv = yargs
type: "boolean",
description: "Run build in production mode"
})
.option("run-build-command", {
type: "boolean",
description: "Run build command for apps"
})
.example(
"node esbuild --apps frappe,erpnext",
"Run build only for frappe and erpnext"
@@ -63,6 +67,8 @@ const APPS = (!argv.apps ? app_list : argv.apps.split(",")).filter(
const FILES_TO_BUILD = argv.files ? argv.files.split(",") : [];
const WATCH_MODE = Boolean(argv.watch);
const PRODUCTION = Boolean(argv.production);
const RUN_BUILD_COMMAND = !WATCH_MODE && Boolean(argv["run-build-command"]);

const TOTAL_BUILD_TIME = `${chalk.black.bgGreen(" DONE ")} Total Build Time`;
const NODE_PATHS = [].concat(
// node_modules of apps directly importable
@@ -76,7 +82,7 @@ const NODE_PATHS = [].concat(
);

execute()
.then(() => !WATCH_MODE && run_build_command_for_apps(APPS))
.then(() => RUN_BUILD_COMMAND && run_build_command_for_apps(APPS))
.catch(e => console.error(e));

async function execute() {


+ 2
- 0
frappe/build.py Voir le fichier

@@ -221,6 +221,8 @@ def bundle(mode, apps=None, make_copy=False, restore=False, verbose=False, skip_
if files:
command += " --files {files}".format(files=','.join(files))

command += " --run-build-command"

check_yarn()
frappe_app_path = frappe.get_app_path("frappe", "..")
frappe.commands.popen(command, cwd=frappe_app_path, env=get_node_env())


Chargement…
Annuler
Enregistrer