Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Module improvements #3

Open
pi0 opened this issue Feb 23, 2021 · 1 comment
Open

Module improvements #3

pi0 opened this issue Feb 23, 2021 · 1 comment

Comments

@pi0
Copy link

pi0 commented Feb 23, 2021

Thanks for this module! I'm adding few improvement ideas:

  • Array convention for passing module options, is being deprecated. It would be nice supporting top level fathom key in nuxt.config (example)
  • It would be nice supporting runtimeConfig for setting analytics id (this way id can be set after build based on deployment). For this, we need to export a function from template file
  • Module is better to be installed as devDependency and added in buildModules instead of modules since we don't add any runtime extension by module
  • It would be nice adding option types (example)
@tillsanders
Copy link
Contributor

tillsanders commented Feb 25, 2021

@pi0 Great suggestions, I created a PR to address these! I'm not 100 % sure about the runtime config, though. It works, but there might be a more elegant way? I was expecting this to contain the Nuxt Context, so I could access $config. Instead I had to access publicRuntimeConfig. See here: https://github.com/yabhq/nuxt-fathom/pull/4/files#diff-cdd77182e73349d6c83fbbce1cccf6f15972fbece4dbd9c52eececf1ca3bfcd5R21

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

No branches or pull requests

2 participants