Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion packages/micro/src/lib/handler.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Native
import { pathToFileURL } from 'url';
// Utilities
import { logError } from './error';

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) {
Expand Down