You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Indeed AST parsing is most reliable but costs performance impact that we can not simply use it for DX purpose anymore in many places. These utilities are mainly needed to have a quick guess on file format and inline to use vite or rollup's AST parser and transforms.
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
The text was updated successfully, but these errors were encountered: