diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f9b40f..0fd5249 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,8 @@ jobs: with: node-version: 10.x - - uses: actions/cache@v2 + - name: Yarn cache + uses: actions/cache@v2 with: path: .yarn/cache key: yarn-${{ hashFiles('yarn.lock') }} diff --git a/build.js b/build.js index 1f1c899..f0b9e65 100755 --- a/build.js +++ b/build.js @@ -38,9 +38,13 @@ const compiler = webpack({ extensions: [`.mjs`, `.js`, `.ts`, `.tsx`, `.json`], }, - externals: Object.fromEntries( - EXTERNALS.map((name) => [name, `commonjs ${name}`]) - ), + externals: (() => { + const res = {}; + for (const name of EXTERNALS) { + res[name] = `commonjs ${name}`; + } + return res; + })(), module: { rules: [