feat(dashboard,admin-sdk,admin-shared,admin-vite-plugin): Add support for UI extensions (#7383)
* intial work * update lock * add routes and fix HMR of configs * cleanup * rm imports * rm debug from plugin * address feedback * address feedback
This commit is contained in:
committed by
GitHub
parent
521c252dee
commit
f1176a0673
32
packages/admin-next/admin-vite-plugin/src/babel.ts
Normal file
32
packages/admin-next/admin-vite-plugin/src/babel.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { parse, type ParseResult, type ParserOptions } from "@babel/parser"
|
||||
import _traverse, { type NodePath } from "@babel/traverse"
|
||||
import {
|
||||
ExportDefaultDeclaration,
|
||||
ExportNamedDeclaration,
|
||||
File,
|
||||
ObjectProperty,
|
||||
} from "@babel/types"
|
||||
|
||||
/**
|
||||
* Depending on whether we are running the CJS or ESM build of the plugin, we
|
||||
* need to import the default export of the `@babel/traverse` package in
|
||||
* different ways.
|
||||
*/
|
||||
let traverse: typeof _traverse
|
||||
|
||||
if (typeof _traverse === "function") {
|
||||
traverse = _traverse
|
||||
} else {
|
||||
traverse = (_traverse as any).default
|
||||
}
|
||||
|
||||
export { parse, traverse }
|
||||
export type {
|
||||
ExportDefaultDeclaration,
|
||||
ExportNamedDeclaration,
|
||||
File,
|
||||
NodePath,
|
||||
ObjectProperty,
|
||||
ParseResult,
|
||||
ParserOptions,
|
||||
}
|
||||
Reference in New Issue
Block a user