@@ -136,23 +136,22 @@ module.exports = class PatternLab {
136
136
*/
137
137
//todo, move this to plugin_manager
138
138
initializePlugins ( patternlab ) {
139
- // console.log('initialize plugins');
140
- // if (!patternlab.config.plugins) {
141
- // return;
142
- // }
143
- // const plugin_manager = new pm(
144
- // patternlab.config,
145
- // path.resolve(__dirname, '../../patternlab-config.json')
146
- // );
147
- // const nodeModulesPath = path.join(process.cwd(), 'node_modules');
148
- // const foundPlugins = findModules(nodeModulesPath, plugin_manager.is_plugin);
149
- // console.log(148, foundPlugins, patternlab.config.plugins);
150
- // foundPlugins.forEach(plugin => {
151
- // logger.info(`Found plugin: plugin-${plugin.name}`);
152
- // logger.info(`Attempting to load and initialize plugin.`);
153
- // const pluginModule = plugin_manager.load_plugin(plugin.modulePath);
154
- // pluginModule(patternlab);
155
- // });
139
+ if ( ! patternlab . config . plugins ) {
140
+ return ;
141
+ }
142
+ const plugin_manager = new pm (
143
+ patternlab . config ,
144
+ path . resolve ( __dirname , '../../patternlab-config.json' )
145
+ ) ;
146
+ const nodeModulesPath = path . join ( process . cwd ( ) , 'node_modules' ) ;
147
+ const foundPlugins = findModules ( nodeModulesPath , plugin_manager . is_plugin ) ;
148
+ console . log ( 148 , foundPlugins , patternlab . config . plugins ) ;
149
+ foundPlugins . forEach ( plugin => {
150
+ logger . info ( `Found plugin: plugin-${ plugin . name } ` ) ;
151
+ logger . info ( `Attempting to load and initialize plugin.` ) ;
152
+ const pluginModule = plugin_manager . load_plugin ( plugin . modulePath ) ;
153
+ pluginModule ( patternlab ) ;
154
+ } ) ;
156
155
}
157
156
158
157
buildGlobalData ( additionalData ) {
0 commit comments