From 1c66a9ea0befcdec27d18b34e1b82261db8f744b Mon Sep 17 00:00:00 2001 From: pshu Date: Mon, 16 Dec 2024 11:03:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20workaround=20due=20mako's?= =?UTF-8?q?=20interop=20add=20default=20to=20a=20empty=20file=20(#12846)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 workaround due mako's interop add default to a empty file * fix: 🐛 ci node setup * fix: 🐛 node 12/14 does not support macos-latest use M1 chips in gh actions * chore: 🎨 add a comment --- .github/workflows/ci.yml | 7 +++---- packages/runtime/src/Plugin/Plugin.ts | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8582611aecb..1511912dcc23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,18 +16,17 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node_version: [12.x, 14.x] - os: [ubuntu-latest, macos-latest, windows-latest] + node_version: [12, 14] + os: [ubuntu-latest, macos-13, windows-latest] fail-fast: false steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - name: Use Node.js ${{ matrix.node_version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node_version }} - registry-url: 'https://registry.yarnpkg.com' - name: restore lerna id: cache uses: actions/cache@v2 diff --git a/packages/runtime/src/Plugin/Plugin.ts b/packages/runtime/src/Plugin/Plugin.ts index 82306b8cb33c..40fc7911cd33 100644 --- a/packages/runtime/src/Plugin/Plugin.ts +++ b/packages/runtime/src/Plugin/Plugin.ts @@ -41,6 +41,11 @@ export default class Plugin { assert(!!plugin.apply, `register failed, plugin.apply must supplied`); assert(!!plugin.path, `register failed, plugin.path must supplied`); Object.keys(plugin.apply).forEach((key) => { + // workaround for https://github.com/umijs/mako/issues/1657 + // root cause: mako bundler will add a default export to an empty module + if (key === 'default') { + return; + } assert( this.validKeys.indexOf(key) > -1, `register failed, invalid key ${key} from plugin ${plugin.path}.`,