vue-cli-plugin-axios
Advanced tools
Comparing version
@@ -8,23 +8,23 @@ module.exports = (api, options, rootOptions) => { | ||
}); | ||
}; | ||
// Render vuetify plugin file | ||
api.render( | ||
{ | ||
"./src/plugins/axios.js": "./templates/plugins/axios.js" | ||
}, | ||
opts | ||
); | ||
// Render vuetify plugin file | ||
api.render( | ||
{ | ||
"./src/plugins/axios.js": "./templates/plugins/axios.js" | ||
}, | ||
opts | ||
); | ||
const fs = require("fs"); | ||
// adapted from https://github.com/Akryum/vue-cli-plugin-apollo/blob/master/generator/index.js#L68-L91 | ||
api.onCreateComplete(() => { | ||
const fs = require("fs"); | ||
// adapted from https://github.com/Akryum/vue-cli-plugin-apollo/blob/master/generator/index.js#L68-L91 | ||
api.onCreateComplete(() => { | ||
// Modify main.js | ||
helpers.updateMain(src => { | ||
const vueImportIndex = src.findIndex(line => line.match(/^import Vue/)) | ||
const vueImportIndex = src.findIndex(line => line.match(/^import Vue/)); | ||
src.splice(vueImportIndex + 1, 0, 'import \'./plugins/axios\'') | ||
src.splice(vueImportIndex + 1, 0, "import './plugins/axios'"); | ||
return src | ||
}) | ||
}) | ||
return src; | ||
}); | ||
}); | ||
}; |
{ | ||
"name": "vue-cli-plugin-axios", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Vue-cli-3 plugin: axios", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
4975
0.48%122
0.83%