Closed rafaesc closed 5 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.
Same way as jest or babel
@elevatebart It has a sense for me, I agree with you.
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.
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
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.
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.
transfered to main repo
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.