storybook/docs/_snippets/storybook-main-webpack-preset-config.md
2024-11-17 16:46:37 +00:00

22 lines
487 B
Markdown

```js filename=".storybook/main.js" renderer="common" language="js"
export async function webpack(baseConfig, options) {
// Modify or replace config.
// Mutating the original reference object can cause unexpected bugs,
// so in this example we replace.
const { module = {} } = baseConfig;
return {
...baseConfig,
module: {
...module,
rules: [
...(module.rules || []),
{
/* some new loader */
},
],
},
};
}
```