Skip to content
New issue

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

Unable to find config options #338

Closed
SteveALee opened this issue Jul 16, 2022 · 10 comments
Closed

Unable to find config options #338

SteveALee opened this issue Jul 16, 2022 · 10 comments

Comments

@SteveALee
Copy link

Sorry If I missed it but I cannot fond the reference for the various config options that can be passed to the plugin factory function. A few are distributed around the docs and examples, some code snippets in the docs include others. Some look like they are vite config options that might be passed through.

I'd expect to see then listed or linked to here:

https://vite-plugin-pwa.netlify.app/guide/#configuring-vite-plugin-pwa

@userquin
Copy link
Member

@SteveALee the types are in the README file: https://github.com/antfu/vite-plugin-pwa#-full-config.

I will add a link to the types to the docs: https://github.com/antfu/vite-plugin-pwa/blob/main/src/types.ts

@userquin
Copy link
Member

userquin commented Jul 16, 2022

@SteveALee I'm adding a PWA Builder application, check this PR #331.

You can also check the preview in previous PR, the app is WIP, the generate button does nothing...

@SteveALee
Copy link
Author

For now I found the the list of names and default values here - https://github.com/antfu/vite-plugin-pwa/blob/main/src/options.ts#L40-L59

@SteveALee
Copy link
Author

SteveALee commented Jul 16, 2022

@userquin Oops, seems I needed to refresh the page before adding my comment - thanks/ Not used typescript for so long I forgot about types being descriptive!

@SteveALee
Copy link
Author

Adding a link is good idea for folks like me reading the docs on their phone not using an IDE with intellisense. :)

PS Using the vite vanilla template plus this plugin is super simple way to create a PWA - thank you and team.

@userquin
Copy link
Member

@SteveALee are you asking for client (virtual modules) or plugin types? anyway, in the README page (at bottom) you have both links.

I'll add both links to the docs.

@SteveALee
Copy link
Author

SteveALee commented Jul 16, 2022

@userquin

I'm after all the options and values for the object passed to the plugin factory function VitePWA used in vite.congif.js

import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
  plugins: [
    VitePWA({ 
      registerType: 'autoUpdate',
      devOptions: {
        enabled: true
      }
    })
  ]
})

These are fully described in the types file you provided above. Thanks

Nice little builder.
I used the vanilla vite template - no framework - and I notice neither docs or builder really address that choice.

@userquin
Copy link
Member

@SteveALee check this repo: https://github.com/userquin/vite-plugin-pwa-vanillajs

@userquin
Copy link
Member

@SteveALee added on FAQ, on the guide index and also in the frameworks index: check #339

@SteveALee
Copy link
Author

@userquin Looks good. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants