11const util = require ( 'util' ) ;
22const webpack = require ( 'webpack' ) ;
33
4+ const isConfigDebugMode = process . env . STORYBOOK_CONFIG_LOG === 'debug' ;
5+
46module . exports = {
5- features : {
6- previewCsfV3 : true ,
7- } ,
87 stories : [
98 '../src/**/*.stories.mdx' ,
109 '../src/**/*.stories.@(js|jsx|ts|tsx|mdx)' ,
1110 ] ,
1211 babel : async options => {
13- console . log ( '------BABEL--------' ) ;
14- console . log ( util . inspect ( options , { showHidden : false , depth : null } ) ) ;
12+ if ( isConfigDebugMode ) {
13+ console . log ( '------BABEL--------' ) ;
14+ console . log ( util . inspect ( options , { showHidden : false , depth : null } ) ) ;
15+ }
1516 return options ;
1617 } ,
1718 webpackFinal : async ( config , { configType } ) => {
1819 const newConfig = {
1920 ...config ,
20- entry : [
21- 'bootstrap-loader?extractStyles' ,
22- 'font-awesome-webpack!./src/theme/font-awesome.config.js' ,
23- ...config . entry ,
24- ] ,
2521 module : {
2622 ...config . module ,
2723 rules : [
@@ -56,10 +52,6 @@ module.exports = {
5652 } ,
5753 plugins : [
5854 ...config . plugins ,
59- new webpack . ProvidePlugin ( {
60- $ : 'jquery' ,
61- jQuery : 'jquery' ,
62- } ) ,
6355 new webpack . DefinePlugin ( {
6456 CONSOLE_ASSET_VERSION : Date . now ( ) . toString ( ) ,
6557 'process.hrtime' : ( ) => null ,
@@ -71,9 +63,10 @@ module.exports = {
7163 ] ,
7264 } ;
7365
74- console . log ( '------WEBPACK--------' ) ;
75- console . log ( util . inspect ( newConfig , { showHidden : false , depth : null } ) ) ;
76- // console.log(util.inspect(config, { showHidden: false, depth: null }));
66+ if ( isConfigDebugMode ) {
67+ console . log ( '------WEBPACK--------' ) ;
68+ console . log ( util . inspect ( newConfig , { showHidden : false , depth : null } ) ) ;
69+ }
7770
7871 // Return the altered config
7972 return newConfig ;
0 commit comments