pwa.js 469 B

123456789101112131415
  1. module.exports = cli => {
  2. cli.injectFeature({
  3. name: 'Progressive Web App (PWA) Support',
  4. value: 'pwa',
  5. short: 'PWA',
  6. description: 'Improve performances with features like Web manifest and Service workers',
  7. link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa'
  8. })
  9. cli.onPromptComplete((answers, options) => {
  10. if (answers.features.includes('pwa')) {
  11. options.plugins['@vue/cli-plugin-pwa'] = {}
  12. }
  13. })
  14. }