UNOMI-189 : Fixed for webpack usage
Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/05347571 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/05347571 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/05347571 Branch: refs/heads/master Commit: 053475715adaf80bef68fac79f4a6fad88a43e31 Parents: 83aa411 Author: tdraier <dra...@apache.org> Authored: Thu Sep 20 17:10:16 2018 +0200 Committer: tdraier <dra...@apache.org> Committed: Thu Sep 20 17:10:16 2018 +0200 ---------------------------------------------------------------------- .../javascript/dist/unomi-tracker.js | 14 +- .../javascript/dist/unomi-tracker.min.js | 4 +- extensions/web-tracker/javascript/package.json | 8 +- extensions/web-tracker/javascript/src/index.js | 6 - extensions/web-tracker/javascript/yarn.lock | 271 ++++++++++++++++++- .../src/main/webapp/javascript/unomi-tracker.js | 14 +- .../main/webapp/javascript/unomi-tracker.min.js | 4 +- 7 files changed, 286 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/05347571/extensions/web-tracker/javascript/dist/unomi-tracker.js ---------------------------------------------------------------------- diff --git a/extensions/web-tracker/javascript/dist/unomi-tracker.js b/extensions/web-tracker/javascript/dist/unomi-tracker.js index 73d96a9..188f885 100644 --- a/extensions/web-tracker/javascript/dist/unomi-tracker.js +++ b/extensions/web-tracker/javascript/dist/unomi-tracker.js @@ -2497,7 +2497,7 @@ var analytics = new Analytics(); // Expose `require`. // TODO(ndhoule): Look into deprecating, we no longer need to expose it in tests -analytics.require = require; +//analytics.require = require; // Expose package version. analytics.VERSION = require('../package.json').version; @@ -11867,8 +11867,9 @@ module.exports={ "author": "Apache Software Foundation", "license": "Apache-2.0", "scripts": { - "build": "yarn browserify && yarn minify", + "build": "yarn browserify && yarn replace && yarn minify", "browserify": "browserify src/index.js -p [ browserify-header --file src/license.js ] -s unomiTracker > dist/unomi-tracker.js", + "replace": "replace-in-file 'analytics.require = require' '//analytics.require = require' dist/unomi-tracker.js", "minify": "uglifyjs -c -m --comments '/@license/' -o dist/unomi-tracker.min.js -- dist/unomi-tracker.js", "snippet:minify": "uglifyjs -c -m -o snippet.min.js -- snippet.js", "clean": "rimraf *.log dist/unomi-tracker.js dist/unomi-tracker.min.js", @@ -11877,7 +11878,8 @@ module.exports={ "dependencies": { "@segment/analytics.js-core": "^3.7.2", "@segment/analytics.js-integration": "^2.1.1", - "browserify-header": "^0.9.4" + "browserify-header": "^0.9.4", + "replace-in-file": "^3.4.2" }, "devDependencies": { "@segment/eslint-config": "^3.1.1", @@ -12410,12 +12412,6 @@ var Integrations = require('./integrations'); module.exports = exports = analytics; /** - * Expose require. - */ - -analytics.require = require; - -/** * Expose `VERSION`. */