From 7bcd62cfee0dcca9a3510b8ba61db7c014078706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 15 Dec 2018 09:07:39 +0100 Subject: [PATCH] Build standalone on prepublish --- Makefile | 8 +++++++- .../babel-preset-env-standalone/scripts/prepublish.js | 11 +++++++++++ packages/babel-standalone/scripts/prepublish.js | 7 +++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 packages/babel-preset-env-standalone/scripts/prepublish.js create mode 100644 packages/babel-standalone/scripts/prepublish.js diff --git a/Makefile b/Makefile index d1032af00d..d8a4157885 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,12 @@ build-standalone: build-preset-env-standalone: ./node_modules/.bin/gulp build-babel-preset-env-standalone +prepublish-build-standalone: + BABEL_ENV=production IS_PUBLISH=true ./node_modules/.bin/gulp build-babel-standalone + +prepublish-build-preset-env-standalone: + BABEL_ENV=production IS_PUBLISH=true ./node_modules/.bin/gulp build-babel-preset-env-standalone + build-dist: build cd packages/babel-polyfill; \ scripts/build-dist.sh @@ -115,7 +121,7 @@ prepublish-build: rm -rf packages/babel-runtime/helpers rm -rf packages/babel-runtime-corejs2/helpers rm -rf packages/babel-runtime-corejs2/core-js - BABEL_ENV=production IS_PUBLISH=true make build-dist + BABEL_ENV=production make build-dist make clone-license prepublish: diff --git a/packages/babel-preset-env-standalone/scripts/prepublish.js b/packages/babel-preset-env-standalone/scripts/prepublish.js new file mode 100644 index 0000000000..bff650fb03 --- /dev/null +++ b/packages/babel-preset-env-standalone/scripts/prepublish.js @@ -0,0 +1,11 @@ +// This file is executed by lerna before publishing, +// @babel/preset-env-standalone so that it has the +// new version and not the old one. + +require("child_process").execSync( + "make prepublish-build-preset-env-standalone", + { + cwd: require("path").resolve(__dirname, "../../.."), + stdio: "inherit", + } +); diff --git a/packages/babel-standalone/scripts/prepublish.js b/packages/babel-standalone/scripts/prepublish.js new file mode 100644 index 0000000000..daadffb117 --- /dev/null +++ b/packages/babel-standalone/scripts/prepublish.js @@ -0,0 +1,7 @@ +// This file is executed by lerna before publishing @babel/standalone, +// so that it has the new version and not the old one. + +require("child_process").execSync("make prepublish-build-standalone", { + cwd: require("path").resolve(__dirname, "../../.."), + stdio: "inherit", +});