mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-19 05:02:40 +08:00
Limit to development
This commit is contained in:
parent
a3db517a7a
commit
2ae46dc6a5
@ -16,14 +16,15 @@ export function babelDefault(config: TransformOptions) {
|
||||
};
|
||||
}
|
||||
|
||||
export function webpackFinal(config: Configuration, { typescriptOptions }: StorybookOptions) {
|
||||
export function webpackFinal(config: Configuration) {
|
||||
const isDevelopment = config.mode === 'development';
|
||||
return {
|
||||
...config,
|
||||
module: {
|
||||
...config.module,
|
||||
rules: [
|
||||
...config.module.rules,
|
||||
{
|
||||
isDevelopment && {
|
||||
test: /\.[jt]sx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
@ -35,8 +36,8 @@ export function webpackFinal(config: Configuration, { typescriptOptions }: Story
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
].filter(Boolean),
|
||||
},
|
||||
plugins: [...config.plugins, new ReactRefreshWebpackPlugin()],
|
||||
plugins: [...config.plugins, isDevelopment && new ReactRefreshWebpackPlugin()].filter(Boolean),
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user