Skip to main content
Glama
babel.esm.config.mjs799 B
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import { types } from '@babel/core'; /** * Babel plugin to rewrite import.meta properties to old school properties * This is used to ensure that the code runs correctly in both CommonJS and ESM environments */ const rewrites = { env: 'process.env', dirname: '__dirname', main: 'require.main === module', url: '__dirname', }; function esmPlugin() { return { visitor: { MemberExpression(path) { if (types.isMetaProperty(path.node.object)) { const rewrite = rewrites[path.node.property.name]; if (rewrite) { path.replaceWithSourceString(rewrite); } } }, }, }; } export default esmPlugin;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/medplum/medplum'

If you have feedback or need assistance with the MCP directory API, please join our Discord server