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
  • Loading branch information
ndelangen committed Dec 21, 2023
2 parents 851d9c2 + f8f8552 commit 2ea84ae
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 @@ -67,10 +67,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 @@ -65,7 +65,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 2ea84ae

Please sign in to comment.