Skip to content

Commit

Permalink
Applying preset options for vue-docgen-api (extending PR #9699)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dschungelabenteuer committed Mar 13, 2021
1 parent e0fecd0 commit f478cac
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion addons/docs/src/frameworks/vue/preset.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
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')] }),
enforce: 'post',
options: {
docgenOptions: {
alias: webpackConfig.resolve.alias,
...options.vueDocgenOptions,
...vueDocgenOptions,
},
},
});
Expand Down

0 comments on commit f478cac

Please sign in to comment.