Skip to content

Commit 1e41b7c

Browse files
fix: use cache for exports and imports plugins
2 parents a197605 + 592f3d9 commit 1e41b7c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,25 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [ubuntu-latest, windows-latest, macos-latest]
29-
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 21.x]
29+
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 22.x]
3030
runs-on: ${{ matrix.os }}
3131
steps:
3232
- uses: actions/checkout@v4
33+
- uses: actions/github-script@v7
34+
id: calculate_architecture
35+
with:
36+
result-encoding: string
37+
script: |
38+
if ('${{ matrix.os }}' === 'macos-latest' && ('${{ matrix['node-version'] }}' === '10.x' || '${{ matrix['node-version'] }}' === '12.x' || '${{ matrix['node-version'] }}' === '14.x')) {
39+
return "x64"
40+
} else {
41+
return ''
42+
}
3343
- name: Use Node.js ${{ matrix.node-version }}
3444
uses: actions/setup-node@v4
3545
with:
3646
node-version: ${{ matrix.node-version }}
47+
architecture: ${{ steps.calculate_architecture.outputs.result }}
3748
cache: yarn
3849
- name: Install dependencies
3950
run: |

lib/ExportsFieldPlugin.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
"use strict";
77

8-
const path = require("path");
98
const DescriptionFileUtils = require("./DescriptionFileUtils");
109
const forEachBail = require("./forEachBail");
1110
const { processExportsField } = require("./util/entrypoints");
@@ -137,7 +136,7 @@ module.exports = class ExportsFieldPlugin {
137136
const obj = {
138137
...request,
139138
request: undefined,
140-
path: path.join(
139+
path: resolver.join(
141140
/** @type {string} */ (request.descriptionFileRoot),
142141
relativePath
143142
),

lib/ImportsFieldPlugin.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
"use strict";
77

8-
const path = require("path");
98
const DescriptionFileUtils = require("./DescriptionFileUtils");
109
const forEachBail = require("./forEachBail");
1110
const { processImportsField } = require("./util/entrypoints");
@@ -143,7 +142,7 @@ module.exports = class ImportsFieldPlugin {
143142
const obj = {
144143
...request,
145144
request: undefined,
146-
path: path.join(
145+
path: resolver.join(
147146
/** @type {string} */ (request.descriptionFileRoot),
148147
path_
149148
),

0 commit comments

Comments
 (0)