diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c56a1b4..0c337cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,14 +26,25 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 21.x] + node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 22.x] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - uses: actions/github-script@v7 + id: calculate_architecture + with: + result-encoding: string + script: | + if ('${{ matrix.os }}' === 'macos-latest' && ('${{ matrix['node-version'] }}' === '10.x' || '${{ matrix['node-version'] }}' === '12.x' || '${{ matrix['node-version'] }}' === '14.x')) { + return "x64" + } else { + return '' + } - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} + architecture: ${{ steps.calculate_architecture.outputs.result }} cache: yarn - name: Install dependencies run: | diff --git a/lib/ExportsFieldPlugin.js b/lib/ExportsFieldPlugin.js index a164e88..f31ff32 100644 --- a/lib/ExportsFieldPlugin.js +++ b/lib/ExportsFieldPlugin.js @@ -5,7 +5,6 @@ "use strict"; -const path = require("path"); const DescriptionFileUtils = require("./DescriptionFileUtils"); const forEachBail = require("./forEachBail"); const { processExportsField } = require("./util/entrypoints"); @@ -137,7 +136,7 @@ module.exports = class ExportsFieldPlugin { const obj = { ...request, request: undefined, - path: path.join( + path: resolver.join( /** @type {string} */ (request.descriptionFileRoot), relativePath ), diff --git a/lib/ImportsFieldPlugin.js b/lib/ImportsFieldPlugin.js index d106960..5ccb3bb 100644 --- a/lib/ImportsFieldPlugin.js +++ b/lib/ImportsFieldPlugin.js @@ -5,7 +5,6 @@ "use strict"; -const path = require("path"); const DescriptionFileUtils = require("./DescriptionFileUtils"); const forEachBail = require("./forEachBail"); const { processImportsField } = require("./util/entrypoints"); @@ -143,7 +142,7 @@ module.exports = class ImportsFieldPlugin { const obj = { ...request, request: undefined, - path: path.join( + path: resolver.join( /** @type {string} */ (request.descriptionFileRoot), path_ ),