You don’t need to do anything special, only need to export your element like normal, and the consumer of your code can register that themselves.
Or you can enforce consumption of your plugin via plugin API only, via exporting a single configure
function like following example:
import { FrameworkConfiguration } from 'aurelia-framework';
import { MyElement } from './my-element';
import { CustomElementRegistry } from 'aurelia-web-components';
export function configure(config: FrameworkConfiguration) {
// need to register with `postTask` to ensures all core modules have been initialized
config.postTask(() => {
config.get(CustomElementRegistry).register(MyElement);
});
}
Then in other app, consume your plugin:
import { configure as configureMyElementWebComponent } from 'my-element-module';
...
aurelia.use.plugin(configureMyElementWebComponent);
// or
aurelia.use.plugin(PLATFORM.moduleName('my-element-module'));