From 54a80090e25573f6e17d1aa51548e02ebf15d3de Mon Sep 17 00:00:00 2001 From: linbudu599 Date: Tue, 7 Nov 2023 14:08:16 +0800 Subject: [PATCH] fix(@ice/app): requireHook in createService --- .changeset/soft-coats-cover.md | 5 +++++ packages/ice/bin/ice-cli.mjs | 2 -- packages/ice/src/createService.ts | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/soft-coats-cover.md diff --git a/.changeset/soft-coats-cover.md b/.changeset/soft-coats-cover.md new file mode 100644 index 0000000000..9ee39dfc1a --- /dev/null +++ b/.changeset/soft-coats-cover.md @@ -0,0 +1,5 @@ +--- +'@ice/app': patch +--- + +move require hijack to createService diff --git a/packages/ice/bin/ice-cli.mjs b/packages/ice/bin/ice-cli.mjs index b9b9dba617..2d07f5eafb 100755 --- a/packages/ice/bin/ice-cli.mjs +++ b/packages/ice/bin/ice-cli.mjs @@ -6,8 +6,6 @@ import fse from 'fs-extra'; import { fileURLToPath } from 'url'; import { program, Option } from 'commander'; import yargsParser from 'yargs-parser'; -// hijack webpack before import other modules -import '../esm/requireHook.js'; import createService from '../esm/createService.js'; import { TARGETS, WEB } from '../esm/constant.js'; diff --git a/packages/ice/src/createService.ts b/packages/ice/src/createService.ts index 6c5aa16bc5..932e0f3276 100644 --- a/packages/ice/src/createService.ts +++ b/packages/ice/src/createService.ts @@ -1,3 +1,5 @@ +// hijack webpack before import other modules +import './requireHook.js'; import * as path from 'path'; import { fileURLToPath } from 'url'; import { createRequire } from 'module';