-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Description
Provide utilities to use regex based static analyzes detecting if potentially ESM or CommonJS syntax is used in a code
hasESMSyntax(code: string, id?: string)
(note: dynamic import is not esm syntax`hasCJSSyntax(code: string, id?: string)
detectSyntax(code: string, id?: string): esm | cjs | mixed | unknown
Some reference: https://github.com/unjs/jiti/blob/main/src/utils.ts#L27
danielroe and antfu
Metadata
Metadata
Assignees
Labels
No labels