From 3da11f94e3e72d6eb3e849bd3851adeb597cec0a Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Tue, 5 Nov 2024 15:07:32 -0500 Subject: [PATCH] Revert "Don't use nodeisms" This reverts commit a15f40eb10b2cbb18595bcf94f6308a1c4d63626. --- src/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index f18c52a..8bf9f73 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,10 @@ import type * as Babel from '@babel/core'; import type { types as t, NodePath } from '@babel/core'; +import { createRequire } from 'node:module'; import { ImportUtil, type Importer } from 'babel-import-util'; import { globalId } from './global-id.ts'; - -// TS can't find declarations for this package (there aren't any) -// @ts-ignore -import { default as decoratorSyntax } from '@babel/plugin-syntax-decorators'; +const req = createRequire(import.meta.url); +const { default: decoratorSyntax } = req('@babel/plugin-syntax-decorators'); interface State extends Babel.PluginPass { currentClassBodies: t.ClassBody[];