Skip to content

Commit

Permalink
Revert "Add an error if you run --stats-json in Vite dev mode"
Browse files Browse the repository at this point in the history
This reverts commit 2097d70.
  • Loading branch information
tmeasday committed Feb 21, 2024
1 parent 2097d70 commit 1f993e2
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 22 deletions.
1 change: 0 additions & 1 deletion code/builders/builder-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"@storybook/channels": "workspace:*",
"@storybook/client-logger": "workspace:*",
"@storybook/core-common": "workspace:*",
"@storybook/core-events": "workspace:*",
"@storybook/csf-plugin": "workspace:*",
"@storybook/node-logger": "workspace:*",
"@storybook/preview": "workspace:*",
Expand Down
7 changes: 1 addition & 6 deletions code/builders/builder-vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { RequestHandler } from 'express';
import type { ViteDevServer } from 'vite';
import express from 'express';
import { dirname, join, parse } from 'path';
import { NoStatsForViteDevError } from '@storybook/core-events/server-errors';
import type { Options } from '@storybook/types';
import { transformIframeHtml } from './transform-iframe-html';
import { createViteServer } from './vite-server';
Expand Down Expand Up @@ -69,11 +68,7 @@ export const start: ViteBuilder['start'] = async ({

return {
bail,
stats: {
toJson: () => {
throw new NoStatsForViteDevError();
},
},
stats: { toJson: () => null },
totalTime: process.hrtime(startTime),
};
};
Expand Down
14 changes: 0 additions & 14 deletions code/lib/core-events/src/errors/server-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,17 +576,3 @@ export class UpgradeStorybookUnknownCurrentVersionError extends StorybookError {
`;
}
}

export class NoStatsForViteDevError extends StorybookError {
readonly category = Category.BUILDER_VITE;

readonly code = 1;

template() {
return dedent`
Unable to write preview stats as the Vite builder does not support stats in dev mode.
Please remove the \`--stats-json\` flag when running in dev mode.
`;
}
}
1 change: 0 additions & 1 deletion code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5334,7 +5334,6 @@ __metadata:
"@storybook/channels": "workspace:*"
"@storybook/client-logger": "workspace:*"
"@storybook/core-common": "workspace:*"
"@storybook/core-events": "workspace:*"
"@storybook/csf-plugin": "workspace:*"
"@storybook/node-logger": "workspace:*"
"@storybook/preview": "workspace:*"
Expand Down

0 comments on commit 1f993e2

Please sign in to comment.