@taplytics/nuxtjs
Advanced tools
Comparing version 0.0.0-rc.1 to 0.0.0-rc.2
@@ -60,3 +60,3 @@ const cheerio = require("cheerio"); | ||
async function TaplyticsModule({ token }) { | ||
async function TaplyticsModule({ token, ssr = true }) { | ||
this.addPlugin({ | ||
@@ -69,15 +69,17 @@ src: resolve(__dirname, "plugin/plugin.js"), | ||
}); | ||
this.nuxt.hook("render:route", (url, result, context) => { | ||
// pull config from vuex state | ||
const { | ||
config: { webElements, webModifications, urlTargetingRules }, | ||
} = context.nuxt.state.TaplyticsConfig; | ||
result.html = processServerModifications( | ||
webModifications, | ||
webElements, | ||
urlTargetingRules, | ||
url, | ||
result.html | ||
); | ||
}); | ||
if (ssr) { | ||
this.nuxt.hook("render:route", (url, result, context) => { | ||
// pull config from vuex state | ||
const { | ||
config: { webElements, webModifications, urlTargetingRules }, | ||
} = context.nuxt.state.TaplyticsConfig; | ||
result.html = processServerModifications( | ||
webModifications, | ||
webElements, | ||
urlTargetingRules, | ||
url, | ||
result.html | ||
); | ||
}); | ||
} | ||
} | ||
@@ -84,0 +86,0 @@ |
{ | ||
"name": "@taplytics/nuxtjs", | ||
"version": "0.0.0-rc.1", | ||
"version": "0.0.0-rc.2", | ||
"description": "Simple Nuxt.js integration with Taplytics Experimentation SDK", | ||
@@ -5,0 +5,0 @@ "main": "lib/module.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
12354
4
336
1
111