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", +});