Skip to content
Snippets Groups Projects
Unverified Commit a6e23bcc authored by Paul Rosenzweig's avatar Paul Rosenzweig Committed by GitHub
Browse files

Pass MB_EDITION to webpack build (#13780)

* pass mb-edition to webpack build

* oops. pass "ee" rather than ":ee"
parent d8e09bf7
No related merge requests found
......@@ -15,15 +15,24 @@
(u/sh {:dir u/project-root-directory} "./bin/i18n/build-translation-resources")
(u/announce "Translation resources built successfully.")))
(defn- edition-from-env-var []
;; MB_EDITION is either oss/ee, but the Clojure build scripts currently use :ce/:ee
(if-not (env/env :mb-edition)
:ce
(case (env/env :mb-edition)
"oss" :ce
"ee" :ee)))
(defn- build-frontend! []
(u/step "Build frontend"
(u/step "Run 'yarn' to download javascript dependencies"
(u/sh {:dir u/project-root-directory} "yarn"))
(u/step "Run 'webpack' with NODE_ENV=production to assemble and minify frontend assets"
(u/sh {:dir u/project-root-directory
:env {"PATH" (env/env :path)
"HOME" (env/env :user-home)
"NODE_ENV" "production"}}
:env {"PATH" (env/env :path)
"HOME" (env/env :user-home)
"NODE_ENV" "production"
"MB_EDITION" (name (edition-from-env-var))}}
"./node_modules/.bin/webpack" "--bail"))
(u/announce "Frontend built successfully.")))
......@@ -77,14 +86,6 @@
(step-fn {:version version, :edition edition}))
(u/announce "All build steps finished."))))
(defn- edition-from-env-var []
;; MB_EDITION is either oss/ee, but the Clojure build scripts currently use :ce/:ee
(if-not (env/env :mb-edition)
:ce
(case (env/env :mb-edition)
"oss" :ce
"ee" :ee)))
(defn -main [& steps]
(u/exit-when-finished-nonzero-on-exception
(build! (merge {:edition (edition-from-env-var)}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment