From 39aabeb7d645dcf4f0286e3bd40a35fc6952e3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 11 Aug 2020 14:41:01 -0400 Subject: [PATCH] chore: build babel-polyfill-dist on make watch --- Makefile | 4 ++-- .../src/index.js | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 9b33cbcb2a83..7567b5185659 100644 --- a/Makefile +++ b/Makefile @@ -75,8 +75,8 @@ build-no-bundle: clean clean-lib BABEL_ENV=development $(YARN) gulp build-no-bundle # Ensure that build artifacts for types are created during local # development too. - $(MAKE) generate-type-helpers - $(MAKE) build-typings + # Babel-transform-fixture-test-runner requires minified polyfill for performance + $(MAKE) generate-type-helpers build-typings build-polyfill-dist build-no-bundle-ci: bootstrap-only $(MAKE) build-no-bundle diff --git a/packages/babel-helper-transform-fixture-test-runner/src/index.js b/packages/babel-helper-transform-fixture-test-runner/src/index.js index 2917364da347..f593854dd9bb 100644 --- a/packages/babel-helper-transform-fixture-test-runner/src/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/src/index.js @@ -18,6 +18,7 @@ import QuickLRU from "quick-lru"; import diff from "jest-diff"; +const babelPolyfillPath = resolve.sync("@babel/polyfill/dist/polyfill.min.js"); const cachedScripts = new QuickLRU({ maxSize: 10 }); const contextModuleCache = new WeakMap(); const sharedTestContext = createContext(); @@ -38,12 +39,7 @@ function createContext() { // Initialize the test context with the polyfill, and then freeze the global to prevent implicit // global creation in tests, which could cause things to bleed between tests. - runModuleInTestContext( - "@babel/polyfill/dist/polyfill.min", - __filename, - context, - moduleCache, - ); + runModuleInTestContext(babelPolyfillPath, __filename, context, moduleCache); // Populate the "babelHelpers" global with Babel's helper utilities. runCacheableScriptInTestContext(