From 9ecdb4fdee32580069bd7c895c46c5a817191344 Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Thu, 14 Apr 2022 01:27:14 +0800 Subject: [PATCH 1/2] fix: build standalone on windows --- Gulpfile.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Gulpfile.mjs b/Gulpfile.mjs index 553b544b452b..0f8788afa00a 100644 --- a/Gulpfile.mjs +++ b/Gulpfile.mjs @@ -297,6 +297,15 @@ function buildRollup(packages, targetBrowsers) { input, external, onwarn(warning, warn) { + function normalizePath(str) { + return typeof str == "string" + ? str.split(path.sep).join(path.posix.sep) + : str; + } + + warning.importer = normalizePath(warning.importer); + warning.exporter = normalizePath(warning.exporter); + if (warning.code === "CIRCULAR_DEPENDENCY") return; if (warning.code === "UNUSED_EXTERNAL_IMPORT") { warn(warning); From 8ae5056ad457f47865092a5cd029465f8951db2b Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Thu, 14 Apr 2022 14:14:43 +0800 Subject: [PATCH 2/2] fix --- Gulpfile.mjs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Gulpfile.mjs b/Gulpfile.mjs index 0f8788afa00a..1a82cd93a1d6 100644 --- a/Gulpfile.mjs +++ b/Gulpfile.mjs @@ -297,14 +297,7 @@ function buildRollup(packages, targetBrowsers) { input, external, onwarn(warning, warn) { - function normalizePath(str) { - return typeof str == "string" - ? str.split(path.sep).join(path.posix.sep) - : str; - } - - warning.importer = normalizePath(warning.importer); - warning.exporter = normalizePath(warning.exporter); + const osifyPath = str => str.split("/").join(path.sep); if (warning.code === "CIRCULAR_DEPENDENCY") return; if (warning.code === "UNUSED_EXTERNAL_IMPORT") { @@ -317,14 +310,15 @@ function buildRollup(packages, targetBrowsers) { // We can safely ignore this warning, and let Rollup replace it with undefined. if ( warning.code === "MISSING_EXPORT" && - warning.exporter === "packages/babel-core/src/index.ts" && + warning.exporter === + osifyPath("packages/babel-core/src/index.ts") && warning.missing === "default" && [ "@babel/helper-define-polyfill-provider", "babel-plugin-polyfill-corejs2", "babel-plugin-polyfill-corejs3", "babel-plugin-polyfill-regenerator", - ].some(pkg => warning.importer.includes(pkg)) + ].some(pkg => warning.importer.includes(osifyPath(pkg))) ) { return; }