rollup-plugin-archieml

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

A Rollup plugin that enables importing ArchieML (.aml) files as JavaScript modules. Current stable version is 1.2.1, released in 2021. It converts ArchieML documents into JavaScript objects via the archieml npm package, making it easy to load structured text data in Rollup builds. The plugin is minimal, with no external runtime dependencies, and provides a simple default import. It supports both ESM and CJS output formats but does not include TypeScript types (users must provide their own). Compared to manual loading, it integrates seamlessly with Rollup's bundling pipeline.

error Error: Could not resolve './data.aml' from 'src/index.js'
cause Rollup cannot parse .aml files without the plugin; the plugin not added to configuration.
fix
Add archieml() to plugins array in rollup.config.js.
error Unexpected token: punc (.)
cause ArchieML syntax error in .aml file.
fix
Validate the ArchieML file with archieml.org or a linter.
gotcha The plugin only supports .aml files. Make sure your files have the .aml extension.
fix Rename files to .aml or customize the include/exclude options (not exposed).
npm install rollup-plugin-archieml
yarn add rollup-plugin-archieml
pnpm add rollup-plugin-archieml

Shows how to configure Rollup with the plugin and import an .aml file.

// rollup.config.js
import archieml from 'rollup-plugin-archieml';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'esm',
  },
  plugins: [archieml()],
};

// src/index.js
import data from './data.aml';
console.log(data);

// data.aml
key: value
list:
* item1
* item2