Update config documentation. Promote to v1

This commit is contained in:
Jarek Rozanski 2023-05-27 10:13:48 +00:00
parent 7ed872ec05
commit 9c753e625b
3 changed files with 22 additions and 16 deletions

View file

@ -27,9 +27,13 @@ You can enable Wide Angle Analytics in your Nuxt projects in just few steps. No
export default defineNuxtConfig({ export default defineNuxtConfig({
modules: ['wideangle-nuxt'], modules: ['wideangle-nuxt'],
runtimeConfig: {
public: {
wideangle: { wideangle: {
siteId: "8D27G3B9ACA01F4241" siteId: "8D27G3B9ACA01F4241"
} }
}
}
}) })
``` ```
@ -57,6 +61,8 @@ Example:
export default defineNuxtConfig({ export default defineNuxtConfig({
modules: ['wideangle-nuxt'], modules: ['wideangle-nuxt'],
runtimeConfig: {
public: {
wideangle: { wideangle: {
siteId: "8D27G3B9ACA01F4241", siteId: "8D27G3B9ACA01F4241",
domain: "your.domain.com", domain: "your.domain.com",
@ -65,7 +71,9 @@ export default defineNuxtConfig({
includeParams: ['q', 'customerId'], includeParams: ['q', 'customerId'],
excludePaths: ['^/admin.*'], excludePaths: ['^/admin.*'],
ignoreHash: true ignoreHash: true
}u }
}
}
}) })
``` ```

View file

@ -1,6 +1,6 @@
{ {
"name": "wideangle-nuxt", "name": "wideangle-nuxt",
"version": "0.0.1", "version": "1.0.0",
"description": "Wide Angle Analytics module for Nuxt", "description": "Wide Angle Analytics module for Nuxt",
"repository": "inputobjects/wideangle-nuxt", "repository": "inputobjects/wideangle-nuxt",
"author": "Wide Angle Analytics <developers@wideangle.co>", "author": "Wide Angle Analytics <developers@wideangle.co>",

View file

@ -31,10 +31,8 @@ export default defineNuxtModule<ModuleOptions>({
}, },
setup (options, nuxt) { setup (options, nuxt) {
const runtimeDir = fileURLToPath(new URL('./runtime', import.meta.url)) const runtimeDir = fileURLToPath(new URL('./runtime', import.meta.url))
nuxt.options.build.transpile.push(runtimeDir) nuxt.options.build.transpile.push(runtimeDir);
const resolver = createResolver(import.meta.url);
logger.info(`Module options: ${JSON.stringify(options)}`);
const resolver = createResolver(import.meta.url)
addImports({ addImports({
name: "useWaaEvent", name: "useWaaEvent",