Skip to content

Commit 0850fd6

Browse files
committed
feat(API): remove reliance on patternlab object during plugin install
1 parent 0f227a3 commit 0850fd6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/core/src/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010

1111
'use strict';
1212

13+
const path = require('path');
14+
1315
const updateNotifier = require('update-notifier');
1416

1517
const packageInfo = require('../package.json');
1618
const help = require('./lib/help');
1719
const events = require('./lib/events');
1820
const pe = require('./lib/pattern_exporter');
21+
const pm = require('./lib/plugin_manager');
1922

2023
const defaultConfig = require('../patternlab-config.json');
2124

@@ -154,7 +157,11 @@ const patternlab_module = function(config) {
154157
* @returns {void}
155158
*/
156159
installplugin: function(pluginName) {
157-
patternlab.installPlugin(pluginName);
160+
//get the config
161+
const configPath = path.resolve(process.cwd(), 'patternlab-config.json');
162+
const plugin_manager = new pm(config, configPath);
163+
164+
plugin_manager.install_plugin(pluginName);
158165
},
159166

160167
/**

0 commit comments

Comments
 (0)