Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allowing extending axios #98
In fact, you add the auth plugin just after the first axios plugin, so it inits before the config file:
With that, I can't use this module at all, because all the axios config I need (especially x-api-key header) is set after the auth plugin.
Do you have any quick solution, or do you want a PR?
@breakingrobot do you see any problem if instead of adding the plugin just after $axios we just push it at the end of plugins array and let the user choose the order? Why did you do this particular trick?
- // ...add plugin just after $axios - const index = this.options.plugins.findIndex(p => - /axios\.js$/.test(p.src || p) - ) - this.options.plugins.splice(index + 1, 0, join(this.options.buildDir, dst)) + // just push the plugin at the end + this.options.plugins.push(join(this.options.buildDir, dst))
Thanks for your answer.
referenced this issue
Mar 29, 2018
@mathieutu But we can't add it to the end. Users may provide plugins to extend auth too (just like axios) (thus depend on it).
Update: now auth uses