diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4a4cbf..a65d29c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,5 +37,8 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' }} run: pnpm type-check + - name: Build + run: pnpm build + - name: Test run: pnpm test diff --git a/package.json b/package.json index c3b4e5e..28468b8 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "build": "pkgroll --target node12.20 --minify", "lint": "eslint .", "type-check": "tsc --noEmit", - "test": "pnpm build && tsx tests/index.ts", + "test": "tsx tests/index.ts", "prepack": "pnpm build && clean-pkg-json" }, "dependencies": { diff --git a/src/index.ts b/src/index.ts index f0f793b..86a0a79 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,7 +17,6 @@ import { import type { TransformOptions } from 'esbuild'; const isPathPattern = /^\.{0,2}\//; -const isTsFilePatten = /\.[cm]?tsx?$/; const nodeModulesPath = `${path.sep}node_modules${path.sep}`; const tsconfig = ( @@ -185,7 +184,7 @@ function resolveTsFilename( if ( parent?.filename - && isTsFilePatten.test(parent.filename) + && fileMatcher?.(parent.filename) && tsPath ) { try { diff --git a/tests/utils/node-with-loader.ts b/tests/utils/node-with-loader.ts index 0b4715a..6a51bee 100644 --- a/tests/utils/node-with-loader.ts +++ b/tests/utils/node-with-loader.ts @@ -41,7 +41,9 @@ export async function createNode( nodeVersion: string, fixturePath: string, ) { - const node = await getNode(nodeVersion); + const node = await getNode(nodeVersion, { + arch: 'x64', + }); return { version: node.version,