Plugin dependency
Plugins are allowed to depend on each other, and mini-star
will automatically handle the topological ordering of plugin dependencies.
How to use
./plugins/alert/src/index.ts:
import Swal from 'sweetalert2';
export function alert(text: string) {
Swal.fire(text);
}
./plugins/test/src/index.ts:
import { alert as myAlert } from '@plugins/alert';
console.log('myAlert', myAlert);
myAlert('Test Alert');
Custom plugin address auto-completion logic
Custom configuration at runtime using pluginUrlBuilder
import { initMiniStar } from 'mini-star';
initMiniStar({
pluginUrlBuilder: (pluginName: string) => '/path/to/pluginDir' // for example: (pluginName) => `http://localhost:3000/plugins/${pluginName}/index.js`
})