1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.loadPlugins = void 0;
|
4 | const store_1 = require("./store");
|
5 | async function loadPlugins(api) {
|
6 | const plugins = api.config.plugins;
|
7 | for (const plugin of plugins) {
|
8 | const { name, apply } = plugin;
|
9 | if (apply) {
|
10 | try {
|
11 | apply(store_1.store);
|
12 | }
|
13 | catch (error) {
|
14 | error.message = `Failed to load plugin "${name}", ${error.message}`;
|
15 | throw error;
|
16 | }
|
17 | }
|
18 | }
|
19 | }
|
20 | exports.loadPlugins = loadPlugins;
|