From 54c78ecc4dfca9cbb5b7b5620d67b78d09a4b88c Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Tue, 14 Jan 2025 18:29:34 +0800 Subject: [PATCH] Fix ERR_REQUIRE_ASYNC_MODULE error when executing gulp (#23687) --- build-scripts/gulp/index.mjs | 17 +++++++++++++++++ gulpfile.js | 14 +------------- 2 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 build-scripts/gulp/index.mjs diff --git a/build-scripts/gulp/index.mjs b/build-scripts/gulp/index.mjs new file mode 100644 index 0000000000..8ae6311ff2 --- /dev/null +++ b/build-scripts/gulp/index.mjs @@ -0,0 +1,17 @@ +import "./app.js"; +import "./cast.js"; +import "./clean.js"; +import "./compress.js"; +import "./demo.js"; +import "./download-translations.js"; +import "./entry-html.js"; +import "./fetch-nightly-translations.js"; +import "./gallery.js"; +import "./gather-static.js"; +import "./gen-icons-json.js"; +import "./hassio.js"; +import "./landing-page.js"; +import "./locale-data.js"; +import "./rspack.js"; +import "./service-worker.js"; +import "./translations.js"; diff --git a/gulpfile.js b/gulpfile.js index 45e0680504..1cf9a7488c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,16 +1,4 @@ -import { globIterate } from "glob"; import { availableParallelism } from "node:os"; +import "./build-scripts/gulp/index.mjs"; process.env.UV_THREADPOOL_SIZE = availableParallelism(); - -const gulpImports = []; - -for await (const gulpModule of globIterate("build-scripts/gulp/*.?(c|m)js", { - dotRelative: true, -})) { - gulpImports.push(import(gulpModule)); -} - -// Since all tasks are currently registered with gulp.task(), this is enough -// If any are converted to named exports, need to loop and aggregate exports here -await Promise.all(gulpImports);