From 51d77a305537383ea66eda1d734045ecd871fc97 Mon Sep 17 00:00:00 2001 From: Davison Long Date: Thu, 17 Dec 2020 15:18:28 -0500 Subject: [PATCH] added transpiled lib generation with prepare script and set main field to point there, also updated umd build in dist --- .gitignore | 1 + babel.config.js | 2 +- dist/fb-pixel.js | 2 +- package.json | 19 ++++-- webpack.config.dev.js | 17 ++++- webpack.config.dist.js | 17 ++++- yarn.lock | 141 +++++++++++++++++++++++++++++++++++++++-- 7 files changed, 183 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 11dd98a..d723658 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ npm-debug.log .c9 package-lock.json .vscode/ +lib/ \ No newline at end of file diff --git a/babel.config.js b/babel.config.js index 6010105..cd0fceb 100644 --- a/babel.config.js +++ b/babel.config.js @@ -3,7 +3,7 @@ module.exports = { [ '@babel/preset-env', { - modules: false, + modules: 'cjs', }, ], ], diff --git a/dist/fb-pixel.js b/dist/fb-pixel.js index e7c9b4a..a675e3c 100644 --- a/dist/fb-pixel.js +++ b/dist/fb-pixel.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ReactPixel=e():t.ReactPixel=e()}(window,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function o(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u;e=window,n=document,o="script",e.fbq||(c=e.fbq=function(){c.callMethod?c.callMethod.apply(c,arguments):c.queue.push(arguments)},e._fbq||(e._fbq=c),c.push=c,c.loaded=!0,c.version="2.0",c.queue=[],(f=n.createElement(o)).async=!0,f.src="https://connect.facebook.net/en_US/fbevents.js",(l=n.getElementsByTagName(o)[0]).parentNode.insertBefore(f,l)),t?(!1===s.autoConfig&&fbq("set","autoConfig",!1,t),fbq("init",t,d),r=!0,i=s.debug):a("Please insert pixel id for initializing")},pageView:function(){f()&&(fbq("track","PageView"),i&&c("called fbq('track', 'PageView');"))},track:function(t,e){f()&&(fbq("track",t,e),i&&(c("called fbq('track', '".concat(t,"');")),e&&c("with data",e)))},trackSingle:function(t,e,n){f()&&(fbq("trackSingle",t,e,n),i&&(c("called fbq('trackSingle', '".concat(t,"', '").concat(e,"');")),n&&c("with data",n)))},trackCustom:function(t,e){f()&&(fbq("trackCustom",t,e),i&&(c("called fbq('trackCustom', '".concat(t,"');")),e&&c("with data",e)))},trackSingleCustom:function(t,e,n){f()&&(fbq("trackSingle",t,e,n),i&&(c("called fbq('trackSingleCustom', '".concat(t,"', '").concat(e,"');")),n&&c("with data",n)))},grantConsent:function(){f()&&(fbq("consent","grant"),i&&c("called fbq('consent', 'grant');"))},revokeConsent:function(){f()&&(fbq("consent","revoke"),i&&c("called fbq('consent', 'revoke');"))},fbq:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){if(f()){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u;r="undefined"!=typeof window&&!!window.fbq,e=window,n=document,o="script",e.fbq||(c=e.fbq=function(){c.callMethod?c.callMethod.apply(c,arguments):c.queue.push(arguments)},e._fbq||(e._fbq=c),c.push=c,c.loaded=!0,c.version="2.0",c.queue=[],(f=n.createElement(o)).async=!0,f.src="https://connect.facebook.net/en_US/fbevents.js",(l=n.getElementsByTagName(o)[0]).parentNode.insertBefore(f,l)),t?(!1===s.autoConfig&&fbq("set","autoConfig",!1,t),fbq("init",t,d),r=!0,i=s.debug):a("Please insert pixel id for initializing")},pageView:function(){f()&&(fbq("track","PageView"),i&&c("called fbq('track', 'PageView');"))},track:function(t,e){f()&&(fbq("track",t,e),i&&(c("called fbq('track', '".concat(t,"');")),e&&c("with data",e)))},trackSingle:function(t,e,n){f()&&(fbq("trackSingle",t,e,n),i&&(c("called fbq('trackSingle', '".concat(t,"', '").concat(e,"');")),n&&c("with data",n)))},trackCustom:function(t,e){f()&&(fbq("trackCustom",t,e),i&&(c("called fbq('trackCustom', '".concat(t,"');")),e&&c("with data",e)))},trackSingleCustom:function(t,e,n){f()&&(fbq("trackSingle",t,e,n),i&&(c("called fbq('trackSingleCustom', '".concat(t,"', '").concat(e,"');")),n&&c("with data",n)))},grantConsent:function(){f()&&(fbq("consent","grant"),i&&c("called fbq('consent', 'grant');"))},revokeConsent:function(){f()&&(fbq("consent","revoke"),i&&c("called fbq('consent', 'revoke');"))},fbq:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){if(f()){for(var t=arguments.length,e=new Array(t),n=0;n