mirror of
https://github.com/kremalicious/gatsby-plugin-matomo.git
synced 2024-12-22 17:23:23 +01:00
package updates
This commit is contained in:
parent
30a58365bf
commit
aeeffda980
16
package.json
16
package.json
@ -16,18 +16,18 @@
|
|||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.8.4",
|
"@babel/cli": "^7.8.4",
|
||||||
"@babel/core": "^7.8.4",
|
"@babel/core": "^7.9.0",
|
||||||
"@babel/runtime": "^7.8.4",
|
"@babel/runtime": "^7.9.2",
|
||||||
"auto-changelog": "^1.16.2",
|
"auto-changelog": "^1.16.2",
|
||||||
"babel-preset-gatsby-package": "^0.2.16",
|
"babel-preset-gatsby-package": "^0.2.18",
|
||||||
"cross-env": "^7.0.0",
|
"cross-env": "^7.0.2",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^6.8.0",
|
||||||
"eslint-config-prettier": "^6.10.0",
|
"eslint-config-prettier": "^6.10.1",
|
||||||
"eslint-plugin-prettier": "^3.1.2",
|
"eslint-plugin-prettier": "^3.1.2",
|
||||||
"jest": "^25.1.0",
|
"jest": "^25.1.0",
|
||||||
"prettier": "^1.19.1",
|
"prettier": "^2.0.1",
|
||||||
"react": "^16.12.0",
|
"react": "^16.13.1",
|
||||||
"release-it": "^12.6.1"
|
"release-it": "^13.1.2"
|
||||||
},
|
},
|
||||||
"homepage": "https://kremalicious.com/gatsby-plugin-matomo",
|
"homepage": "https://kremalicious.com/gatsby-plugin-matomo",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -23,7 +23,7 @@ describe('gatsby-plugin-google-analytics', () => {
|
|||||||
process.env.NODE_ENV = env
|
process.env.NODE_ENV = env
|
||||||
})
|
})
|
||||||
|
|
||||||
const setup = options => {
|
const setup = (options) => {
|
||||||
const setHeadComponents = jest.fn()
|
const setHeadComponents = jest.fn()
|
||||||
const setPostBodyComponents = jest.fn()
|
const setPostBodyComponents = jest.fn()
|
||||||
|
|
||||||
|
@ -53,9 +53,15 @@ function buildTrackingCode(pluginOptions) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildTrackingCodeNoJs(pluginOptions, pathname) {
|
function buildTrackingCodeNoJs(pluginOptions, pathname) {
|
||||||
const { matomoUrl, matomoPhpScript = 'piwik.php', siteId, siteUrl } = pluginOptions
|
const {
|
||||||
const html = `<img src="${matomoUrl}/${matomoPhpScript}?idsite=${siteId}&rec=1&url=${siteUrl +
|
matomoUrl,
|
||||||
pathname}" style="border:0" alt="tracker" />`
|
matomoPhpScript = 'piwik.php',
|
||||||
|
siteId,
|
||||||
|
siteUrl
|
||||||
|
} = pluginOptions
|
||||||
|
const html = `<img src="${matomoUrl}/${matomoPhpScript}?idsite=${siteId}&rec=1&url=${
|
||||||
|
siteUrl + pathname
|
||||||
|
}" style="border:0" alt="tracker" />`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<noscript
|
<noscript
|
||||||
@ -83,12 +89,12 @@ export const onRenderBody = (
|
|||||||
let excludePaths = ['/offline-plugin-app-shell-fallback/']
|
let excludePaths = ['/offline-plugin-app-shell-fallback/']
|
||||||
|
|
||||||
if (pluginOptions && typeof pluginOptions.exclude !== 'undefined') {
|
if (pluginOptions && typeof pluginOptions.exclude !== 'undefined') {
|
||||||
pluginOptions.exclude.map(exclude => {
|
pluginOptions.exclude.map((exclude) => {
|
||||||
excludePaths.push(exclude)
|
excludePaths.push(exclude)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const isPathExcluded = excludePaths.some(path => pathname === path)
|
const isPathExcluded = excludePaths.some((path) => pathname === path)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(isProduction || (pluginOptions && pluginOptions.dev === true)) &&
|
(isProduction || (pluginOptions && pluginOptions.dev === true)) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user