@elenajs/plugin-cem-define
v1.0.0
Published
CEM analyzer plugin that registers the Elena components in the manifest.
Readme
CEM analyzer plugin that registers the Elena components in the manifest
Table of contents
Install
npm install --save-dev @elenajs/plugin-cem-definePeer dependency: @custom-elements-manifest/analyzer >= 0.10.0
Usage
import { elenaDefinePlugin } from "@elenajs/plugin-cem-define";
// In your CEM analyzer config
export default {
plugins: [elenaDefinePlugin()],
};Or when using @elenajs/bundler, add it to the analyze.plugins array in elena.config.mjs:
import { elenaDefinePlugin } from "@elenajs/plugin-cem-define";
export default {
analyze: {
plugins: [elenaDefinePlugin()],
},
};[!NOTE] The
@elenajs/bundleralready includes this plugin by default. You only need to add it manually if you’re using the CEM analyzer independently.
How it works
The plugin scans Elena component source files and extracts the value of the static tagName class field:
class Button extends Elena(HTMLElement) {
static tagName = "elena-button";
}It adds the tagName to the CEM class declaration and creates a custom-element-definition export entry, making the component discoverable by IDEs and documentation tools.
License
MIT
Copyright
Copyright © 2026 Ariel Salminen
