Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack: Remove deprecated standalone webpackConfig option #25481

Merged
merged 3 commits into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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