Allow vue.config.js
to export a function
#3213
Labels
feature request
intend to implement
The team has the intention to implement this feature at some point. Contribution is also welcome.
What problem does this feature solve?
Currently
vue.config.js
only allowed to export an object containing options.When user want to have more complicated configuration, they have to do:
Moreover, we have received several issues asking about how to build with different configurations. (Like this one: #2861) Although this can be done with current api, I thinks it's not intutive enough so that people with limited nodejs knowledge couldn't figure it out.
What does the proposed API look like?
Like what
babel.config.js
did, let user use function to generate configuration:Further more, we can pass some useful information/api as arguments into the configuration function, for example:
The text was updated successfully, but these errors were encountered: