index.js 477 B

1234567891011121314151617
  1. module.exports = (api, options) => {
  2. api.injectImports(api.entryFile, `import store from './store'`)
  3. api.injectRootOptions(api.entryFile, `store`)
  4. api.extendPackage({
  5. dependencies: {
  6. vuex: '^3.0.1'
  7. }
  8. })
  9. api.render('./template')
  10. if (api.invoking && api.hasPlugin('typescript')) {
  11. /* eslint-disable-next-line node/no-extraneous-require */
  12. const convertFiles = require('@vue/cli-plugin-typescript/generator/convert')
  13. convertFiles(api)
  14. }
  15. }