rollup-plugin-eft

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

A Rollup plugin that transforms .eft (ef.js template) files into JavaScript modules. Current stable version 0.17.0. Released as needed, follows ef-core and eft-parser versioning. Key differentiator: enables importing ef.js templates directly in Rollup bundles, with no runtime overhead.

error Error: Cannot find module 'ef-core'
cause Missing peer dependency ef-core.
fix
Run 'npm install ef-core@^0.17.0'
error TypeError: eft is not a function
cause Using named import instead of default import.
fix
Change 'import { eft } from 'rollup-plugin-eft'' to 'import eft from 'rollup-plugin-eft''
error Error: Unexpected token: operator (>)
cause eft file not processed by plugin, likely due to extension not matching.
fix
Ensure import path ends with '.eft' and plugin is included in Rollup config.
gotcha Plugin version 0.17.0 requires ef-core >=0.17.0 and eft-parser >=0.16.5. Incompatible versions cause runtime errors.
fix Ensure peer dependencies are met: 'ef-core@^0.17.0', 'eft-parser@^0.16.5'.
gotcha The plugin only works with Rollup (not Webpack or others). Attempting to use with other bundlers will fail.
fix Use only with Rollup; for other bundlers, look for respective ef.js loaders.
gotcha The plugin does not support hot module replacement (HMR). File changes during dev require a full rebuild.
fix Use with Rollup's watch mode or a separate HMR setup.
npm install rollup-plugin-eft
yarn add rollup-plugin-eft
pnpm add rollup-plugin-eft

Shows basic Rollup config with eft plugin, generating an ESM bundle from a .eft file import.

import { rollup } from 'rollup';
import eft from 'rollup-plugin-eft';

const bundle = await rollup({
  input: 'main.js',
  plugins: [eft()]
});

const { output } = await bundle.generate({ format: 'esm' });
const code = output[0].code;
console.log(code);