Skip to content

Commit 67af593

Browse files
Paul Boocockpaulboocock
authored andcommitted
Fix v_tracker not tracking as expected (closes #848)
1 parent 5302088 commit 67af593

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

gulpfile.babel.js/rollup.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { nodeResolve } from '@rollup/plugin-node-resolve';
22
import commonjs from '@rollup/plugin-commonjs';
33
import { babel } from '@rollup/plugin-babel';
4+
import json from '@rollup/plugin-json';
45
import banner from 'rollup-plugin-banner'
56

67
export const basePlugins = [
8+
json(),
79
nodeResolve({
810
browser: true,
911
dedupe: [ 'lodash', 'uuid' ],

package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@babel/register": "^7.11.5",
2424
"@rollup/plugin-babel": "^5.2.1",
2525
"@rollup/plugin-commonjs": "^15.0.0",
26+
"@rollup/plugin-json": "^4.1.0",
2627
"@rollup/plugin-node-resolve": "^9.0.0",
2728
"@types/babel__core": "^7.1.9",
2829
"@types/jest": "^26.0.13",

src/js/snowplow.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ import forEach from 'lodash/forEach';
7575
import { addEventListener } from './lib/helpers';
7676
import { InQueueManager } from './in_queue';
7777
import { Tracker } from './tracker';
78+
import { version as jsVersion } from '../../package.json'
7879

7980
export function Snowplow(asynchronousQueue, functionName) {
8081
var documentAlias = document,
8182
windowAlias = window,
8283
/* Tracker identifier with version */
83-
version = 'js-' + '<%= pkg.version %>', // Update banner.js too
84+
version = 'js-' + jsVersion,
8485
/* Contains four variables that are shared with tracker.js and must be passed by reference */
8586
mutSnowplowState = {
8687
/* List of request queues - one per Tracker instance */

0 commit comments

Comments
 (0)