mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:21:17 +08:00
Core: Expose entire webpack package to addons, not just compiler
This commit is contained in:
parent
74079bcb61
commit
bd86e6c575
@ -21,7 +21,8 @@ export const executor = {
|
||||
get: async (options: Options) => {
|
||||
const version = ((await options.presets.apply('webpackVersion')) || '4') as string;
|
||||
const webpackInstance =
|
||||
(await options.presets.apply<typeof webpackType>('webpackInstance')) || webpackReal;
|
||||
(await options.presets.apply<{ default: typeof webpackType }>('webpackInstance'))?.default ||
|
||||
webpackReal;
|
||||
checkWebpackVersion({ version }, '4', 'builder-webpack4');
|
||||
return webpackInstance;
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
import webpackReal from 'webpack';
|
||||
import * as webpackReal from 'webpack';
|
||||
import { logger } from '@storybook/node-logger';
|
||||
import { loadCustomWebpackConfig } from '@storybook/core-common';
|
||||
import { createDefaultWebpackConfig } from '../preview/base-webpack.config';
|
||||
|
@ -40,7 +40,8 @@ export const executor = {
|
||||
get: async (options: Options) => {
|
||||
const version = ((await options.presets.apply('webpackVersion')) || '5') as string;
|
||||
const webpackInstance =
|
||||
(await options.presets.apply<typeof webpack>('webpackInstance')) || webpack;
|
||||
(await options.presets.apply<{ default: typeof webpack }>('webpackInstance'))?.default ||
|
||||
webpack;
|
||||
checkWebpackVersion({ version }, '5', 'builder-webpack5');
|
||||
return webpackInstance;
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
import webpackReal from 'webpack';
|
||||
import * as webpackReal from 'webpack';
|
||||
import { logger } from '@storybook/node-logger';
|
||||
import { loadCustomWebpackConfig, Options } from '@storybook/core-common';
|
||||
import type { Configuration } from 'webpack';
|
||||
|
@ -31,7 +31,8 @@ export const executor = {
|
||||
get: async (options: Options) => {
|
||||
const version = ((await options.presets.apply('webpackVersion')) || '4') as string;
|
||||
const webpackInstance =
|
||||
(await options.presets.apply<typeof webpack>('webpackInstance')) || webpack;
|
||||
(await options.presets.apply<{ default: typeof webpack }>('webpackInstance'))?.default ||
|
||||
webpack;
|
||||
checkWebpackVersion({ version }, '4', 'manager-webpack4');
|
||||
return webpackInstance;
|
||||
},
|
||||
|
@ -31,7 +31,8 @@ export const executor = {
|
||||
get: async (options: Options) => {
|
||||
const version = ((await options.presets.apply('webpackVersion')) || '5') as string;
|
||||
const webpackInstance =
|
||||
(await options.presets.apply<typeof webpack>('webpackInstance')) || webpack;
|
||||
(await options.presets.apply<{ default: typeof webpack }>('webpackInstance'))?.default ||
|
||||
webpack;
|
||||
checkWebpackVersion({ version }, '5', 'manager-webpack5');
|
||||
return webpackInstance;
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user