vue-styleguidist / vue-cli-plugin-styleguidist

vue cli 3.0 plugin for vue-styleguidist
MIT License
21 stars 6 forks source link

Suggestion: The configuration of styleguidist.config.js should be in vue.config.js #7

Closed rafaesc closed 5 years ago

rafaesc commented 6 years ago

I reviewed that there are plugins that to provide their configuration through vue.config.js

https://cli.vuejs.org/config/#pluginoptions

Cases: https://github.com/kazupon/vue-cli-plugin-i18n https://github.com/ascendancyy/vue-cli-plugin-stylelint https://github.com/Akryum/vue-cli-plugin-apollo https://github.com/mrbbot/vue-cli-plugin-webpack-bundle-analyzer

But I don't sure if it should be included here.

elevatebart commented 6 years ago

Hey @rafaesc I think we should have both with vue.config.js having the last word. This way we could translate a project to the cli without a big cost in change management.

elevatebart commented 6 years ago

Same way as jest or babel

rafaesc commented 6 years ago

@elevatebart It has a sense for me, I agree with you.

elevatebart commented 6 years ago

Actually, jest and babel use either their own config file (babel => .babelrc.js, jest => jest.config.js) or the package.json. None of them use vue.config.js.

On second thoughts, I think it would be confusing to add an option just for the CLI. We should not do it.

The main confusion would come from the outDir that should be different in for the styleguide and the main app. One should not overwrite the other but they could still share components.

rafaesc commented 6 years ago

Taking the example of vue-cli-plugin-babel,

it allows a customizing through vue.config.js, although there only are two options.

https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-plugin-babel/index.js.

But maybe styleguide.config.js, there are several options to customize that it would overload vue.config.js

elevatebart commented 5 years ago

I think this would have a limited usefulness. The cost might be a little off the charts as for now the configuration file is supposed to be read from a file. Using a litteral or a calcuated value to create a virtual styleguide.config.js. is going to have to be done in styleguidist frst then we can use it here.

elevatebart commented 5 years ago

With the new architecture, it should be pretty straight forward here. The styleguidist function accept both a path to the file or a file itself.

elevatebart commented 5 years ago

transfered to main repo