Skip to content

Commit

Permalink
enabled display error details feature
Browse files Browse the repository at this point in the history
  • Loading branch information
dhuang612 committed Oct 13, 2019
1 parent 8d4b03e commit 4751e49
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 8 additions & 1 deletion lib/core/src/server/build-static.js
Expand Up @@ -130,12 +130,15 @@ async function buildManager(configType, outputDir, configDir, options) {
if (options.debugWebpack) {
logConfig('Manager webpack config', managerConfig);
}
if (options.stats.errorDetails) {
logConfig('Manager webpack config', managerConfig);
}

return compileManager(managerConfig, managerStartTime);
}

async function buildPreview(configType, outputDir, packageJson, options) {
const { watch, debugWebpack } = options;
const { watch, debugWebpack, errorDetails } = options;

logger.info('=> Building preview..');
const previewStartTime = process.hrtime();
Expand All @@ -150,6 +153,10 @@ async function buildPreview(configType, outputDir, packageJson, options) {
...options,
});

if (errorDetails) {
logConfig('Show verbose errors', previewConfig);
}

if (debugWebpack) {
logConfig('Preview webpack config', previewConfig);
}
Expand Down
1 change: 1 addition & 0 deletions lib/core/src/server/cli/dev.js
Expand Up @@ -29,6 +29,7 @@ async function getCLI(packageJson) {
.option('--quiet', 'Suppress verbose build output')
.option('--no-dll', 'Do not use dll reference')
.option('--debug-webpack', 'Display final webpack configurations for debugging purposes')
.option('--display-error-details', 'Show errors')
.option(
'--preview-url [string]',
'Disables the default storybook preview and lets your use your own'
Expand Down
3 changes: 0 additions & 3 deletions lib/core/src/server/manager/manager-webpack.config.js
Expand Up @@ -83,9 +83,6 @@ export default ({
new CoreJSUpgradeWebpackPlugin({ resolveFrom: __dirname }),
].filter(Boolean),
module: {
stats: {
errorDetails: true,
},
rules: [
babelLoader(babelOptions),
{
Expand Down

0 comments on commit 4751e49

Please sign in to comment.