mixpanel-browser 2.73.0 → 2.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +7 -4
- package/.github/workflows/integration-tests.yml +52 -0
- package/.github/workflows/unit-tests.yml +40 -0
- package/CHANGELOG.md +12 -0
- package/README.md +3 -3
- package/build.sh +1 -5
- package/dist/mixpanel-core.cjs.d.ts +12 -1
- package/dist/mixpanel-core.cjs.js +432 -34
- package/dist/mixpanel-recorder.js +5364 -684
- package/dist/mixpanel-recorder.min.js +1 -1
- package/dist/mixpanel-recorder.min.js.map +1 -1
- package/dist/mixpanel-targeting.js +2576 -0
- package/dist/mixpanel-targeting.min.js +2 -0
- package/dist/mixpanel-targeting.min.js.map +1 -0
- package/dist/mixpanel-with-async-modules.cjs.d.ts +522 -0
- package/dist/mixpanel-with-async-modules.cjs.js +9700 -0
- package/dist/mixpanel-with-async-recorder.cjs.d.ts +12 -1
- package/dist/mixpanel-with-async-recorder.cjs.js +432 -34
- package/dist/mixpanel-with-recorder.d.ts +12 -1
- package/dist/mixpanel-with-recorder.js +7889 -2839
- package/dist/mixpanel-with-recorder.min.d.ts +12 -1
- package/dist/mixpanel-with-recorder.min.js +1 -1
- package/dist/mixpanel.amd.d.ts +12 -1
- package/dist/mixpanel.amd.js +8446 -2813
- package/dist/mixpanel.cjs.d.ts +12 -1
- package/dist/mixpanel.cjs.js +8446 -2813
- package/dist/mixpanel.globals.js +432 -34
- package/dist/mixpanel.min.js +182 -173
- package/dist/mixpanel.module.d.ts +12 -1
- package/dist/mixpanel.module.js +8446 -2813
- package/dist/mixpanel.umd.d.ts +12 -1
- package/dist/mixpanel.umd.js +8446 -2813
- package/dist/rrweb-bundled.js +4434 -596
- package/dist/rrweb-compiled.js +5078 -646
- package/package.json +33 -7
- package/rollup.config.mjs +286 -224
- package/src/autocapture/utils.js +15 -7
- package/src/config.js +1 -1
- package/src/flags/index.js +269 -8
- package/src/globals.js +14 -0
- package/src/index.d.ts +12 -1
- package/src/loaders/loader-module.js +1 -0
- package/src/mixpanel-core.js +101 -8
- package/src/recorder/index.js +2 -1
- package/src/recorder/masking.js +197 -0
- package/src/recorder/rrweb-entrypoint.js +2 -1
- package/src/recorder/session-recording.js +43 -4
- package/src/recorder/utils.js +5 -1
- package/src/targeting/event-matcher.js +97 -0
- package/src/targeting/index.js +11 -0
- package/src/targeting/loader.js +36 -0
- package/src/utils.js +12 -10
- package/testServer.js +51 -7
- package/.github/workflows/tests.yml +0 -25
- /package/src/loaders/{loader-module-with-async-recorder.js → loader-module-with-async-modules.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mixpanel-browser",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.75.0",
|
|
4
4
|
"description": "The official Mixpanel JavaScript browser client library",
|
|
5
5
|
"main": "dist/mixpanel.cjs.js",
|
|
6
6
|
"module": "dist/mixpanel.module.js",
|
|
@@ -9,17 +9,29 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "./build.sh",
|
|
12
|
+
"build-watch": "npx rollup -c rollup.config.mjs -w",
|
|
13
|
+
"build-watch:full": "FULL=1 npx rollup -c rollup.config.mjs -w",
|
|
12
14
|
"build-dist": "DIST=1 ./build.sh",
|
|
13
15
|
"build-full": "FULL=1 ./build.sh",
|
|
14
16
|
"build-test-polyfill": "webpack tests/vendor/core-js-polyfills.src.js tests/vendor/core-js-polyfills.js",
|
|
17
|
+
"build-browser-tests": "npx rollup -c tests/browser/client/rollup.config.mjs -w",
|
|
15
18
|
"dox": "node doc/build-docs.js",
|
|
16
19
|
"dox-publish": "rdme docs:single doc/readme.io/javascript-full-api-reference.md --key=$RDME_API_KEY --version=$RDME_DOC_VERSION",
|
|
17
|
-
"
|
|
20
|
+
"test-server": "echo 'Browse to localhost:3001/tests' && node testServer.js",
|
|
21
|
+
"test-server:background": "screen -S testServer -X stuff $^C; screen -X -S testServer quit; screen -d -m -S testServer bash -c 'npm run test-server; exec bash' && wait-on --timeout 10000 http://localhost:3001/tests",
|
|
18
22
|
"lint": "eslint ./src",
|
|
23
|
+
"lint-fix": "eslint --fix ./src && eslint --fix ./tests/browser",
|
|
19
24
|
"prepublishOnly": "npm run build-dist",
|
|
20
25
|
"start": "pushd examples; python -m SimpleHTTPServer; popd",
|
|
21
26
|
"test": "npm run lint && npm run unit-test",
|
|
27
|
+
"test:ci": "npm run lint && npm run unit-test:ci",
|
|
22
28
|
"unit-test": "BABEL_ENV=test mocha --require babel-core/register tests/unit/*.js",
|
|
29
|
+
"unit-test:ci": "BABEL_ENV=test mocha --require babel-core/register tests/unit/*.js --reporter json --reporter-option output=tests/unit/results/results.json",
|
|
30
|
+
"integration-test:local": "wdio run tests/browser/wdio.local.mjs",
|
|
31
|
+
"integration-test:local:watch": "wdio run tests/browser/wdio.local.mjs --watch",
|
|
32
|
+
"integration-test:sauce": "wdio run tests/browser/wdio.sauce.mjs",
|
|
33
|
+
"integration-test": "DEV=1 npm run integration-test:local:watch",
|
|
34
|
+
"integration-test:full": "npm run integration-test:local:watch",
|
|
23
35
|
"validate": "npm ls"
|
|
24
36
|
},
|
|
25
37
|
"types": "./src/index.d.ts",
|
|
@@ -33,40 +45,54 @@
|
|
|
33
45
|
"url": "https://github.com/mixpanel/mixpanel-js/issues"
|
|
34
46
|
},
|
|
35
47
|
"homepage": "https://github.com/mixpanel/mixpanel-js",
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=20 <26"
|
|
50
|
+
},
|
|
36
51
|
"devDependencies": {
|
|
37
52
|
"@ampproject/rollup-plugin-closure-compiler": "0.27.0",
|
|
38
53
|
"@rollup/plugin-alias": "5.1.1",
|
|
54
|
+
"@rollup/plugin-commonjs": "28.0.3",
|
|
39
55
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
40
56
|
"@rollup/plugin-swc": "0.4.0",
|
|
41
57
|
"@swc/core": "1.11.7",
|
|
42
|
-
"
|
|
58
|
+
"@wdio/cli": "9.12.0",
|
|
59
|
+
"@wdio/junit-reporter": "9.12.2",
|
|
60
|
+
"@wdio/local-runner": "9.12.0",
|
|
61
|
+
"@wdio/mocha-framework": "9.11.0",
|
|
62
|
+
"@wdio/sauce-service": "9.21.0",
|
|
63
|
+
"@wdio/spec-reporter": "9.11.0",
|
|
43
64
|
"babel-core": "6.7.2",
|
|
44
65
|
"babel-preset-es2015": "6.6.0",
|
|
45
66
|
"babelify": "6.1.2",
|
|
46
67
|
"browserify": "10.2.4",
|
|
47
68
|
"chai": "4.0.0",
|
|
69
|
+
"chromedriver": "134.0.3",
|
|
48
70
|
"cookie-parser": "1.3.4",
|
|
49
71
|
"core-js": "3.6.5",
|
|
50
72
|
"dox": "0.9.0",
|
|
51
73
|
"eslint": "4.18.2",
|
|
52
|
-
"express": "
|
|
74
|
+
"express": "5.2.1",
|
|
53
75
|
"fake-indexeddb": "6.0.0",
|
|
54
76
|
"jsdom": "16.5.0",
|
|
55
77
|
"jsdom-global": "3.0.2",
|
|
56
78
|
"localStorage": "1.0.4",
|
|
57
79
|
"lodash": "4.17.21",
|
|
58
|
-
"mocha": "
|
|
80
|
+
"mocha": "11.1.0",
|
|
59
81
|
"morgan": "1.9.1",
|
|
82
|
+
"pug": "3.0.3",
|
|
60
83
|
"rdme": "7.5.0",
|
|
61
84
|
"request": "2.88.0",
|
|
62
85
|
"rollup": "4.34.9",
|
|
63
86
|
"rollup-plugin-esbuild": "6.2.1",
|
|
64
87
|
"sinon": "8.1.1",
|
|
65
88
|
"sinon-chai": "3.5.0",
|
|
89
|
+
"wait-on": "8.0.3",
|
|
90
|
+
"wdio-ctrf-json-reporter": "0.0.13",
|
|
66
91
|
"webpack": "1.12.2"
|
|
67
92
|
},
|
|
68
93
|
"dependencies": {
|
|
69
|
-
"@mixpanel/rrweb": "2.0.0-alpha.18.
|
|
70
|
-
"@mixpanel/rrweb-plugin-console-record": "2.0.0-alpha.18.
|
|
94
|
+
"@mixpanel/rrweb": "2.0.0-alpha.18.3",
|
|
95
|
+
"@mixpanel/rrweb-plugin-console-record": "2.0.0-alpha.18.3",
|
|
96
|
+
"json-logic-js": "2.0.5"
|
|
71
97
|
}
|
|
72
98
|
}
|
package/rollup.config.mjs
CHANGED
|
@@ -1,258 +1,320 @@
|
|
|
1
|
-
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
2
|
-
import swc from '@rollup/plugin-swc';
|
|
3
|
-
import esbuild from 'rollup-plugin-esbuild';
|
|
4
1
|
import alias from '@rollup/plugin-alias';
|
|
5
2
|
import closureCompiler from '@ampproject/rollup-plugin-closure-compiler';
|
|
3
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
6
4
|
import fs from 'fs';
|
|
7
5
|
import path from 'path';
|
|
6
|
+
import esbuild from 'rollup-plugin-esbuild';
|
|
7
|
+
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
8
|
+
import swc from '@rollup/plugin-swc';
|
|
9
|
+
import browserTestBuilds from './tests/browser/client/rollup.config.mjs';
|
|
8
10
|
|
|
9
|
-
const COMPILED_RRWEB_PATH =
|
|
10
|
-
const BUNDLED_RRWEB_PATH =
|
|
11
|
+
const COMPILED_RRWEB_PATH = `build/rrweb-compiled.js`;
|
|
12
|
+
const BUNDLED_RRWEB_PATH = `build/rrweb-bundled.js`;
|
|
13
|
+
|
|
14
|
+
// Delete output files at build start so build errors don't silently use stale files
|
|
15
|
+
const cleanOnRebuild = () => {
|
|
16
|
+
let outputFiles = [];
|
|
17
|
+
return {
|
|
18
|
+
name: `clean-on-rebuild`,
|
|
19
|
+
options(opts) {
|
|
20
|
+
const outputs = Array.isArray(opts.output) ? opts.output : [opts.output];
|
|
21
|
+
outputFiles = outputs.map(o => o && o.file).filter(Boolean);
|
|
22
|
+
},
|
|
23
|
+
buildStart() {
|
|
24
|
+
// Delete outputs right before this specific build runs
|
|
25
|
+
for (const file of outputFiles) {
|
|
26
|
+
if (fs.existsSync(file)) {
|
|
27
|
+
fs.unlinkSync(file);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const withCleanOnRebuild = (builds) => builds.map(build => ({
|
|
35
|
+
...build,
|
|
36
|
+
plugins: [cleanOnRebuild(), ...(build.plugins || [])]
|
|
37
|
+
}));
|
|
11
38
|
|
|
12
39
|
const aliasRrweb = () => alias({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
40
|
+
entries: [
|
|
41
|
+
{ find: /rrweb-entrypoint(?:\.js)?$/, replacement: COMPILED_RRWEB_PATH },
|
|
42
|
+
]
|
|
16
43
|
});
|
|
17
44
|
|
|
18
45
|
const copyTypes = () => ({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
name: `copy-types`,
|
|
47
|
+
generateBundle(_options, bundle) {
|
|
48
|
+
try {
|
|
49
|
+
for (const builtFileName of Object.keys(bundle)) {
|
|
50
|
+
const buildDir = `build`;
|
|
51
|
+
const types = fs.readFileSync(`src/index.d.ts`, `utf8`);
|
|
52
|
+
const builtFile = path.basename(builtFileName, path.extname(builtFileName)) + `.d.ts`;
|
|
53
|
+
fs.writeFileSync(path.join(buildDir, builtFile), types);
|
|
54
|
+
}
|
|
28
55
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
56
|
+
} catch (err) {
|
|
57
|
+
console.warn(`Could not copy type files:`, err.message);
|
|
58
|
+
throw err;
|
|
33
59
|
}
|
|
60
|
+
}
|
|
34
61
|
});
|
|
35
62
|
|
|
36
63
|
const COMMON_CLOSURE_FLAGS = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
64
|
+
compilation_level: `ADVANCED_OPTIMIZATIONS`,
|
|
65
|
+
language_in: `ECMASCRIPT5`,
|
|
66
|
+
externs: [`src/externs.js`],
|
|
67
|
+
create_source_map: true,
|
|
40
68
|
};
|
|
41
69
|
|
|
42
70
|
const MINIFY = process.env.MINIFY || process.env.FULL;
|
|
43
71
|
|
|
44
72
|
// Main builds used to develop / iterate quickly
|
|
45
73
|
const MAIN_BUILDS = [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
74
|
+
{
|
|
75
|
+
'input': `src/recorder/rrweb-entrypoint.js`,
|
|
76
|
+
'output': [
|
|
77
|
+
{
|
|
78
|
+
file: BUNDLED_RRWEB_PATH,
|
|
79
|
+
format: `es`,
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
plugins: [nodeResolve({browser: true})]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
'input': BUNDLED_RRWEB_PATH,
|
|
86
|
+
'output': [
|
|
87
|
+
{
|
|
88
|
+
file: COMPILED_RRWEB_PATH,
|
|
89
|
+
format: `es`,
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
plugins: [swc({swc: {jsc: {target: `es5`}}})]
|
|
93
|
+
},
|
|
66
94
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
// IIFE recorder bundle that is loaded asynchronously
|
|
96
|
+
// rrweb uses esbuild to minify, so do that here as well
|
|
97
|
+
{
|
|
98
|
+
input: `src/recorder/index.js`,
|
|
99
|
+
output: [
|
|
100
|
+
{
|
|
101
|
+
file: `build/mixpanel-recorder.js`,
|
|
102
|
+
name: `mixpanel_recorder`,
|
|
103
|
+
format: `iife`,
|
|
104
|
+
},
|
|
105
|
+
...(MINIFY
|
|
106
|
+
? [
|
|
107
|
+
{
|
|
108
|
+
file: `build/mixpanel-recorder.min.js`,
|
|
109
|
+
name: `mixpanel_recorder`,
|
|
110
|
+
format: `iife`,
|
|
111
|
+
plugins: [esbuild({target: `es5`, minify: true, sourceMap: true})],
|
|
112
|
+
sourcemap: true,
|
|
113
|
+
},
|
|
114
|
+
]
|
|
115
|
+
: []),
|
|
116
|
+
],
|
|
117
|
+
plugins: [aliasRrweb()],
|
|
118
|
+
},
|
|
91
119
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
],
|
|
111
|
-
plugins: [
|
|
112
|
-
nodeResolve({
|
|
113
|
-
browser: true,
|
|
114
|
-
main: true,
|
|
115
|
-
jsnext: true,
|
|
116
|
-
})
|
|
120
|
+
// IIFE targeting bundle that is loaded asynchronously
|
|
121
|
+
{
|
|
122
|
+
input: `src/targeting/index.js`,
|
|
123
|
+
output: [
|
|
124
|
+
{
|
|
125
|
+
file: `build/mixpanel-targeting.js`,
|
|
126
|
+
name: `mixpanel_targeting`,
|
|
127
|
+
format: `iife`,
|
|
128
|
+
},
|
|
129
|
+
...(MINIFY
|
|
130
|
+
? [
|
|
131
|
+
{
|
|
132
|
+
file: `build/mixpanel-targeting.min.js`,
|
|
133
|
+
name: `mixpanel_targeting`,
|
|
134
|
+
format: `iife`,
|
|
135
|
+
plugins: [esbuild({target: `es5`, minify: true, sourceMap: true})],
|
|
136
|
+
sourcemap: true,
|
|
137
|
+
},
|
|
117
138
|
]
|
|
118
|
-
|
|
119
|
-
]
|
|
139
|
+
: []),
|
|
140
|
+
],
|
|
141
|
+
plugins: [commonjs(), nodeResolve({browser: true})],
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
// IIFE main mixpanel build
|
|
145
|
+
{
|
|
146
|
+
input: `src/loaders/loader-globals.js`,
|
|
147
|
+
output: [
|
|
148
|
+
{
|
|
149
|
+
file: `build/mixpanel.globals.js`,
|
|
150
|
+
name: `mixpanel`,
|
|
151
|
+
format: `iife`,
|
|
152
|
+
},
|
|
153
|
+
...(MINIFY
|
|
154
|
+
? [
|
|
155
|
+
{
|
|
156
|
+
file: `build/mixpanel.min.js`,
|
|
157
|
+
format: `iife`,
|
|
158
|
+
plugins: [closureCompiler(COMMON_CLOSURE_FLAGS)],
|
|
159
|
+
},
|
|
160
|
+
]
|
|
161
|
+
: []),
|
|
162
|
+
],
|
|
163
|
+
plugins: [
|
|
164
|
+
nodeResolve({
|
|
165
|
+
browser: true,
|
|
166
|
+
main: true,
|
|
167
|
+
jsnext: true,
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
];
|
|
120
172
|
|
|
121
173
|
const ALL_BUILDS = [
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
174
|
+
...MAIN_BUILDS,
|
|
175
|
+
// Minified snippets for loading mixpanel
|
|
176
|
+
{
|
|
177
|
+
input: `src/loaders/mixpanel-jslib-snippet.js`,
|
|
178
|
+
output: [
|
|
179
|
+
{
|
|
180
|
+
file: `build/mixpanel-jslib-snippet.min.js`,
|
|
181
|
+
plugins: [closureCompiler(COMMON_CLOSURE_FLAGS)]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
file: `build/mixpanel-jslib-snippet.min.test.js`,
|
|
185
|
+
plugins: [closureCompiler({...COMMON_CLOSURE_FLAGS, define: `MIXPANEL_LIB_URL="../build/mixpanel.min.js"`})],
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
},
|
|
137
189
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
190
|
+
// IIFE mixpanel snippet loader
|
|
191
|
+
{
|
|
192
|
+
input: `src/loaders/mixpanel-js-wrapper.js`,
|
|
193
|
+
output: [
|
|
194
|
+
{
|
|
195
|
+
file: `build/mixpanel-js-wrapper.js`,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
file: `build/mixpanel-js-wrapper.min.js`,
|
|
199
|
+
plugins: [closureCompiler(COMMON_CLOSURE_FLAGS)],
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
},
|
|
151
203
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
204
|
+
// IIFE mixpanel core with bundled recorder
|
|
205
|
+
{
|
|
206
|
+
input: `src/loaders/loader-globals-with-recorder.js`,
|
|
207
|
+
output: [
|
|
208
|
+
{
|
|
209
|
+
file: `build/mixpanel-with-recorder.js`,
|
|
210
|
+
name: `mixpanel`,
|
|
211
|
+
format: `iife`,
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
file: `build/mixpanel-with-recorder.min.js`,
|
|
215
|
+
name: `mixpanel`,
|
|
216
|
+
format: `iife`,
|
|
217
|
+
plugins: [esbuild({target: `es5`, minify: true, sourceMap: true})],
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
plugins: [
|
|
221
|
+
aliasRrweb(),
|
|
222
|
+
nodeResolve({
|
|
223
|
+
browser: true,
|
|
224
|
+
main: true,
|
|
225
|
+
jsnext: true,
|
|
226
|
+
}),
|
|
227
|
+
copyTypes(),
|
|
228
|
+
],
|
|
229
|
+
},
|
|
178
230
|
|
|
179
231
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
232
|
+
// Modules builds that are bundled with the recorder and targeting
|
|
233
|
+
{
|
|
234
|
+
input: `src/loaders/loader-module.js`,
|
|
235
|
+
output: [
|
|
236
|
+
{
|
|
237
|
+
file: `build/mixpanel.cjs.js`,
|
|
238
|
+
name: `mixpanel`,
|
|
239
|
+
format: `cjs`,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
file: `build/mixpanel.amd.js`,
|
|
243
|
+
name: `mixpanel`,
|
|
244
|
+
format: `amd`,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
file: `build/mixpanel.umd.js`,
|
|
248
|
+
name: `mixpanel`,
|
|
249
|
+
format: `umd`,
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
file: `build/mixpanel.module.js`,
|
|
253
|
+
name: `mixpanel`,
|
|
254
|
+
format: `es`,
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
plugins: [
|
|
258
|
+
commonjs(),
|
|
259
|
+
aliasRrweb(),
|
|
260
|
+
nodeResolve({
|
|
261
|
+
browser: true,
|
|
262
|
+
main: true,
|
|
263
|
+
jsnext: true,
|
|
264
|
+
}),
|
|
265
|
+
copyTypes(),
|
|
266
|
+
],
|
|
267
|
+
},
|
|
215
268
|
|
|
216
269
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
270
|
+
// Alternative CJS builds without recorder
|
|
271
|
+
{
|
|
272
|
+
input: `src/loaders/loader-module-core.js`,
|
|
273
|
+
output: [
|
|
274
|
+
{
|
|
275
|
+
file: `build/mixpanel-core.cjs.js`,
|
|
276
|
+
name: `mixpanel`,
|
|
277
|
+
format: `cjs`,
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
plugins: [
|
|
281
|
+
aliasRrweb(),
|
|
282
|
+
nodeResolve({
|
|
283
|
+
browser: true,
|
|
284
|
+
main: true,
|
|
285
|
+
jsnext: true,
|
|
286
|
+
}),
|
|
287
|
+
copyTypes(),
|
|
288
|
+
],
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
input: `src/loaders/loader-module-with-async-modules.js`,
|
|
292
|
+
output: [
|
|
293
|
+
{
|
|
294
|
+
file: `build/mixpanel-with-async-modules.cjs.js`,
|
|
295
|
+
name: `mixpanel`,
|
|
296
|
+
format: `cjs`,
|
|
297
|
+
},
|
|
298
|
+
// Backward compatibility: keep old output filename for existing users
|
|
299
|
+
{
|
|
300
|
+
file: `build/mixpanel-with-async-recorder.cjs.js`,
|
|
301
|
+
name: `mixpanel`,
|
|
302
|
+
format: `cjs`,
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
plugins: [
|
|
306
|
+
aliasRrweb(),
|
|
307
|
+
nodeResolve({
|
|
308
|
+
browser: true,
|
|
309
|
+
main: true,
|
|
310
|
+
jsnext: true,
|
|
311
|
+
}),
|
|
312
|
+
copyTypes(),
|
|
313
|
+
],
|
|
314
|
+
},
|
|
315
|
+
|
|
316
|
+
...browserTestBuilds,
|
|
256
317
|
];
|
|
257
318
|
|
|
258
|
-
|
|
319
|
+
const builds = process.env.FULL ? ALL_BUILDS : MAIN_BUILDS;
|
|
320
|
+
export default withCleanOnRebuild(builds);
|