Skip to content

Commit

Permalink
fix: use cache for exports and imports plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored May 7, 2024
2 parents a197605 + 592f3d9 commit 1e41b7c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
3 changes: 1 addition & 2 deletions lib/ExportsFieldPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

"use strict";

const path = require("path");
const DescriptionFileUtils = require("./DescriptionFileUtils");
const forEachBail = require("./forEachBail");
const { processExportsField } = require("./util/entrypoints");
Expand Down Expand Up @@ -137,7 +136,7 @@ module.exports = class ExportsFieldPlugin {
const obj = {
...request,
request: undefined,
path: path.join(
path: resolver.join(
/** @type {string} */ (request.descriptionFileRoot),
relativePath
),
Expand Down
3 changes: 1 addition & 2 deletions lib/ImportsFieldPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

"use strict";

const path = require("path");
const DescriptionFileUtils = require("./DescriptionFileUtils");
const forEachBail = require("./forEachBail");
const { processImportsField } = require("./util/entrypoints");
Expand Down Expand Up @@ -143,7 +142,7 @@ module.exports = class ImportsFieldPlugin {
const obj = {
...request,
request: undefined,
path: path.join(
path: resolver.join(
/** @type {string} */ (request.descriptionFileRoot),
path_
),
Expand Down

0 comments on commit 1e41b7c

Please sign in to comment.