diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bc5048d..6b4b98d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,12 +4,13 @@ on: - pull_request jobs: test: - name: Node.js ${{ matrix.node-version }} - runs-on: ubuntu-latest + name: Node.js ${{ matrix.node-version }} ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: matrix: node-version: - 16 + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 diff --git a/packages/micro/src/lib/handler.ts b/packages/micro/src/lib/handler.ts index bc8c32b..a700c48 100644 --- a/packages/micro/src/lib/handler.ts +++ b/packages/micro/src/lib/handler.ts @@ -1,3 +1,5 @@ +// Native +import { pathToFileURL } from 'url'; // Utilities import { logError } from './error'; @@ -5,7 +7,7 @@ export const handle = async (file: string) => { let mod: unknown; try { - mod = await import(file); + mod = await import(pathToFileURL(file).href); mod = await (mod as { default: unknown }).default; // use ES6 module's default export } catch (err: unknown) {