Skip to content

Commit

Permalink
Merge pull request #25755 from storybookjs/valentin/add-babel-swc-log…
Browse files Browse the repository at this point in the history
…ging

Next.js: Add logger statements for compiler selection
  • Loading branch information
valentinpalkovic authored Jan 25, 2024
2 parents 6fdd954 + c0f6d35 commit 311de8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/frameworks/nextjs/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { configureSWCLoader } from './swc/loader';
import { configureBabelLoader } from './babel/loader';
import { configureFastRefresh } from './fastRefresh/webpack';
import { configureAliases } from './aliases/webpack';
import { logger } from '@storybook/node-logger';

export const addons: PresetProperty<'addons'> = [
dirname(require.resolve(join('@storybook/preset-react-webpack', 'package.json'))),
Expand Down Expand Up @@ -173,8 +174,10 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (baseConfig,
}

if (useSWC) {
logger.info('=> Using SWC as compiler');
await configureSWCLoader(baseConfig, options, nextConfig);
} else {
logger.info('=> Using Babel as compiler');
await configureBabelLoader(baseConfig, options);
}

Expand Down

0 comments on commit 311de8e

Please sign in to comment.