mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Applying preset options for vue-docgen-api (extending PR #9699)
This commit is contained in:
parent
e0fecd0121
commit
f478cac140
@ -1,4 +1,16 @@
|
||||
export function webpackFinal(webpackConfig: any = {}, options: any = {}) {
|
||||
let vueDocgenOptions = {};
|
||||
|
||||
options.presetsList.forEach((preset: any) => {
|
||||
if (preset.name.includes('addon-docs') && preset.options.vueDocgenOptions) {
|
||||
const appendableOptions = preset.options.vueDocgenOptions;
|
||||
vueDocgenOptions = {
|
||||
...vueDocgenOptions,
|
||||
...appendableOptions,
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
webpackConfig.module.rules.push({
|
||||
test: /\.vue$/,
|
||||
loader: require.resolve('vue-docgen-loader', { paths: [require.resolve('@storybook/vue')] }),
|
||||
@ -6,7 +18,7 @@ export function webpackFinal(webpackConfig: any = {}, options: any = {}) {
|
||||
options: {
|
||||
docgenOptions: {
|
||||
alias: webpackConfig.resolve.alias,
|
||||
...options.vueDocgenOptions,
|
||||
...vueDocgenOptions,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user