We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For vue plugins, It's useful to have a code injection points (e.g import, instance options) to main.js.
import
main.js
e.g. vue-cli-plugin-apollo replace main.js https://github.com/Akryum/vue-cli-plugin-apollo/blob/master/generator/index.js#L81-L90
vue-cli-plugin-apollo
I think that Geneartor API might need to injectToEntryPoint the below:
injectToEntryPoint
module.exports = (api, options, rootOptions) => { api.injectToEntryPoint({ import: 'i18n', from: './i18n', option: 'i18n' }) }
In main.js template, I think it can render like the below:
https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/generator/template/src/main.js
import Vue from 'vue' import App from './App.vue' <%_ if (options.router) { _%> import router from './router' <%_ } _%> <%_ if (options.vuex) { _%> import store from './store' <%_ } _%> <%_ for(const plugin of options.plugins) { _%> import <%= plugin.import %> from '<%= plugin.from %>' <%_ } _%> Vue.config.productionTip = false new Vue({ <%_ if (options.router) { _%> router, <%_ } _%> <%_ if (options.vuex) { _%> store, <%_ } _%> <%_ for(const plugin of options.plugins) { _%> <%= plugin.option %>, <%_ } _%> render: h => h(App) }).$mount('#app')
The text was updated successfully, but these errors were encountered:
I like this idea.
Sorry, something went wrong.
@yyx990803 if this spec is ok, I'll try to implentation it. 😉
Closing in favor of #845
No branches or pull requests
What problem does this feature solve?
For vue plugins, It's useful to have a code injection points (e.g
import
, instance options) tomain.js
.e.g.
vue-cli-plugin-apollo
replacemain.js
https://github.com/Akryum/vue-cli-plugin-apollo/blob/master/generator/index.js#L81-L90
What does the proposed API look like?
I think that Geneartor API might need to
injectToEntryPoint
the below:In
main.js
template, I think it can render like the below:https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/generator/template/src/main.js
The text was updated successfully, but these errors were encountered: