Skip to content

Commit 99e9942

Browse files
author
Ovidiu Barabula
committed
feat(core): add hooks and load external plugin
1 parent 6cb4ee4 commit 99e9942

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

src/core.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ import TaskManager from './task-manager';
1212
import taskInitProject from './tasks/task-init-project';
1313
import Logger, { ILogger } from './util/logger';
1414

15+
const taskManagerConfig = {
16+
hooks: [
17+
'init',
18+
'config',
19+
'template',
20+
'clean',
21+
'process',
22+
'watch',
23+
],
24+
};
25+
26+
const plugins = [
27+
taskInitProject,
28+
'stylus',
29+
];
30+
1531

1632
/**
1733
* Main Frontvue constructor
@@ -21,16 +37,12 @@ async function Frontvue() {
2137
const logger = Logger(name);
2238
const configManager = await ConfigManager(name);
2339
const configWizard = ConfigWizard(configManager);
24-
const taskManager = TaskManager({
25-
hooks: [
26-
'init',
27-
],
28-
});
40+
const taskManager = TaskManager(taskManagerConfig);
2941
const pluginManager = PluginManager(taskManager, configWizard);
3042
const { run } = taskManager;
3143

32-
// Use custom plugin
33-
await pluginManager.use(taskInitProject);
44+
// Use custom plugin(s)
45+
await pluginManager.use(...plugins);
3446

3547
// Return public API
3648
return Object.freeze({

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy