rollup-plugin-mt2amd

raw JSON →
2.2.0 verified Mon Apr 27 auth: no javascript

A Rollup plugin that converts JavaScript modules using the 'mt' module format (likely a custom or legacy format) to AMD (Asynchronous Module Definition) format. Version 2.2.0 is current; there is no public information on release cadence or known alternatives. This plugin is aimed at users transitioning from a specific module system to AMD for use with RequireJS or similar loaders. The package has low adoption and minimal documentation, indicating it may be niche or internal.

error Error: Cannot find module 'rollup-plugin-mt2amd'
cause Package not installed or import path incorrect.
fix
Run 'npm install rollup-plugin-mt2amd' and ensure using correct import.
error TypeError: mt2amd is not a function
cause Import yields undefined (maybe default vs named export mismatch).
fix
Check the package's export: try 'import { mt2amd } from ...' or 'import * as mt2amd from ...'.
error Plugin error: Invalid mt module syntax
cause Input file does not match expected mt format.
fix
Verify that your module uses the exact mt syntax the plugin expects; refer to plugin source for specifics.
gotcha Unclear export mechanism: The package may export as default or named. Always verify the actual export to avoid import errors.
fix Inspect the package's index.js or TypeScript definitions to determine correct import syntax.
gotcha Undocumented options: Plugin options are not documented; users must read source code to understand configuration.
fix Review the plugin's source code on GitHub to identify accepted options.
gotcha Potential compatibility issues: The plugin may only work with certain mt module format variants. Incompatible inputs may produce unexpected output or errors.
fix Ensure your mt modules conform to the expected format by examining the plugin's transformation logic.
deprecated No active maintenance: The repository has not been updated in years; consider alternatives if possible.
fix Use mt2amd conversion as a one-time migration step or look for similar tools.
npm install rollup-plugin-mt2amd
yarn add rollup-plugin-mt2amd
pnpm add rollup-plugin-mt2amd

Shows basic usage of rollup-plugin-mt2amd to convert mt-format modules to AMD output using Rollup.

import mt2amd from 'rollup-plugin-mt2amd';
import { rollup } from 'rollup';
import resolve from '@rollup/plugin-node-resolve';

const bundle = await rollup({
  input: 'src/index.js',
  plugins: [
    resolve(),
    mt2amd({ /* options */ })
  ]
});
await bundle.write({ format: 'amd', file: 'dist/bundle.js' });