Skip to content

Commit

Permalink
Merge pull request #25286 from storybookjs/norbert/skip-framework-che…
Browse files Browse the repository at this point in the history
…ck-react-native

Core: Skip no-framework error when ignorePreview=true
(cherry picked from commit 2ea84ae)
  • Loading branch information
ndelangen authored and storybook-bot committed Dec 28, 2023
1 parent ee1ac32 commit 519cb5a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions code/lib/core-server/src/build-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,15 @@ export async function buildDevStandalone(
const { framework } = config;
const corePresets = [];

const frameworkName = typeof framework === 'string' ? framework : framework?.name;
validateFrameworkName(frameworkName);
let frameworkName = typeof framework === 'string' ? framework : framework?.name;
if (!options.ignorePreview) {
validateFrameworkName(frameworkName);
}
if (frameworkName) {
corePresets.push(join(frameworkName, 'preset'));
}

corePresets.push(join(frameworkName, 'preset'));
frameworkName = frameworkName || 'custom';

try {
await warnOnIncompatibleAddons(config);
Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-server/src/build-static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
const frameworkName = typeof framework === 'string' ? framework : framework?.name;
if (frameworkName) {
corePresets.push(join(frameworkName, 'preset'));
} else {
} else if (!options.ignorePreview) {
logger.warn(`you have not specified a framework in your ${options.configDir}/main.js`);
}

Expand Down

0 comments on commit 519cb5a

Please sign in to comment.