Skip to content

Commit

Permalink
Merge pull request #25481 from storybookjs/yann/remove-deprecated-web…
Browse files Browse the repository at this point in the history
…pack-config-option

Webpack: Remove deprecated standalone webpackConfig option
  • Loading branch information
valentinpalkovic authored Jan 11, 2024
2 parents 5dfbe0d + b91be03 commit 1086e75
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import * as webpackReal from 'webpack';
import { logger } from '@storybook/node-logger';
import type { Options } from '@storybook/types';
import type { Configuration } from 'webpack';
import deprecate from 'util-deprecate';
import { dedent } from 'ts-dedent';
import { loadCustomWebpackConfig } from '@storybook/core-webpack';
import { createDefaultWebpackConfig } from '../preview/base-webpack.config';

export async function webpack(config: Configuration, options: Options) {
// @ts-expect-error (Converted from ts-ignore)
const { configDir, configType, presets, webpackConfig } = options;
const { configDir, configType, presets } = options;

const coreOptions = await presets.apply('core');

Expand All @@ -20,16 +17,6 @@ export async function webpack(config: Configuration, options: Options) {

const finalDefaultConfig = await presets.apply('webpackFinal', defaultConfig, options);

// through standalone webpackConfig option
if (webpackConfig) {
return deprecate(
webpackConfig,
dedent`
You've provided a webpack config directly in CallOptions, this is not recommended. Please use presets instead. This feature will be removed in 7.0
`
)(finalDefaultConfig);
}

// Check whether user has a custom webpack config file and
// return the (extended) base configuration if it's not available.
const customConfig = loadCustomWebpackConfig(configDir);
Expand Down

0 comments on commit 1086e75

Please sign in to comment.