Sfoglia il codice sorgente

feat(load-test) split to a separate repository

It now lives here https://github.com/jitsi/jitsi-meet-load-test
master
Saúl Ibarra Corretgé 3 anni fa
parent
commit
0b57bcb20b

+ 0
- 2
.eslintignore Vedi File

@@ -3,11 +3,9 @@ build/*
3 3
 
4 4
 # Third-party source code which we (1) do not want to modify or (2) try to
5 5
 # modify as little as possible.
6
-flow-typed/*
7 6
 libs/*
8 7
 resources/*
9 8
 react/features/stream-effects/virtual-background/vendor/*
10
-load-test/*
11 9
 react/features/face-landmarks/resources/*
12 10
 
13 11
 # ESLint will by default ignore its own configuration file. However, there does

+ 1
- 4
Makefile Vedi File

@@ -19,12 +19,9 @@ WEBPACK_DEV_SERVER = ./node_modules/.bin/webpack serve --mode development
19 19
 
20 20
 all: compile deploy clean
21 21
 
22
-compile: compile-load-test
22
+compile:
23 23
 	$(WEBPACK)
24 24
 
25
-compile-load-test:
26
-	${NPM} install --prefix resources/load-test && ${NPM} run build --prefix resources/load-test
27
-
28 25
 clean:
29 26
 	rm -fr $(BUILD_DIR)
30 27
 

+ 0
- 2
debian/jitsi-meet-web.install Vedi File

@@ -14,5 +14,3 @@ resources/robots.txt	/usr/share/jitsi-meet/
14 14
 resources/*.sh			/usr/share/jitsi-meet/scripts/
15 15
 pwa-worker.js			/usr/share/jitsi-meet/
16 16
 manifest.json			/usr/share/jitsi-meet/
17
-resources/load-test/*.html	/usr/share/jitsi-meet/load-test/
18
-resources/load-test/libs	/usr/share/jitsi-meet/load-test/

+ 0
- 13
resources/load-test/index.html Vedi File

@@ -1,13 +0,0 @@
1
-<!DOCTYPE html>
2
-<html>
3
-<head lang="en">
4
-    <meta charset="UTF-8">
5
-    <title></title>
6
-    <script><!--#include virtual="/config.js" --></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
7
-    <script src="../libs/lib-jitsi-meet.min.js?v=139"></script>
8
-    <script src="libs/load-test-participant.min.js" ></script>
9
-</head>
10
-<body>
11
-    <div>Number of participants: <span id="participants">1</span></div>
12
-</body>
13
-</html>

+ 0
- 523
resources/load-test/load-test-participant.js Vedi File

@@ -1,523 +0,0 @@
1
-/* global $, config, JitsiMeetJS */
2
-import 'jquery';
3
-import { setConfigFromURLParams } from '../../react/features/base/config/functions';
4
-import { parseURLParams } from '../../react/features/base/util/parseURLParams';
5
-import { parseURIString } from '../../react/features/base/util/uri';
6
-import { validateLastNLimits, limitLastN } from '../../react/features/base/lastn/functions';
7
-
8
-setConfigFromURLParams(config, {}, {}, window.location);
9
-
10
-const params = parseURLParams(window.location, false, 'hash');
11
-const { isHuman = false } = params;
12
-const {
13
-    localVideo = config.startWithVideoMuted !== true,
14
-    remoteVideo = isHuman,
15
-    remoteAudio = isHuman,
16
-    autoPlayVideo = config.testing.noAutoPlayVideo !== true,
17
-    stageView = config.disableTileView,
18
-    numClients = 1,
19
-    clientInterval = 100 // ms
20
-} = params;
21
-
22
-let {
23
-    localAudio = config.startWithAudioMuted !== true,
24
-} = params;
25
-
26
-const { room: roomName } = parseURIString(window.location.toString());
27
-
28
-class LoadTestClient {
29
-    constructor(id) {
30
-        this.id = id;
31
-        this.connection = null;
32
-        this.connected = false;
33
-        this.room = null;
34
-        this.numParticipants = 1;
35
-        this.localTracks = [];
36
-        this.remoteTracks = {};
37
-        this.maxFrameHeight = 0;
38
-        this.selectedParticipant = null;
39
-    }
40
-
41
-    /**
42
-     * Simple emulation of jitsi-meet's screen layout behavior
43
-     */
44
-    updateMaxFrameHeight() {
45
-        if (!this.connected) {
46
-            return;
47
-        }
48
-
49
-        let newMaxFrameHeight;
50
-
51
-        if (stageView) {
52
-            newMaxFrameHeight = 2160;
53
-        }
54
-        else {
55
-            if (this.numParticipants <= 2) {
56
-                newMaxFrameHeight = 720;
57
-            } else if (this.numParticipants <= 4) {
58
-                newMaxFrameHeight = 360;
59
-            } else {
60
-                this.newMaxFrameHeight = 180;
61
-            }
62
-        }
63
-
64
-        if (this.room && this.maxFrameHeight !== newMaxFrameHeight) {
65
-            this.maxFrameHeight = newMaxFrameHeight;
66
-            this.room.setReceiverVideoConstraint(this.maxFrameHeight);
67
-        }
68
-    }
69
-
70
-    /**
71
-     * Simple emulation of jitsi-meet's lastN behavior
72
-     */
73
-    updateLastN() {
74
-        if (!this.connected) {
75
-            return;
76
-        }
77
-
78
-        let lastN = typeof config.channelLastN === 'undefined' ? -1 : config.channelLastN;
79
-
80
-        const limitedLastN = limitLastN(this.numParticipants, validateLastNLimits(config.lastNLimits));
81
-
82
-        if (limitedLastN !== undefined) {
83
-            lastN = lastN === -1 ? limitedLastN : Math.min(limitedLastN, lastN);
84
-        }
85
-
86
-        if (lastN === this.room.getLastN()) {
87
-            return;
88
-        }
89
-
90
-        this.room.setLastN(lastN);
91
-    }
92
-
93
-    /**
94
-     * Helper function to query whether a participant ID is a valid ID
95
-     * for stage view.
96
-     */
97
-    isValidStageViewParticipant(id) {
98
-        return (id !== room.myUserId() && room.getParticipantById(id));
99
-    }
100
-
101
-    /**
102
-     * Simple emulation of jitsi-meet's stage view participant selection behavior.
103
-     * Doesn't take into account pinning or screen sharing, and the initial behavior
104
-     * is slightly different.
105
-     * @returns Whether the selected participant changed.
106
-     */
107
-    selectStageViewParticipant(selected, previous) {
108
-        let newSelectedParticipant;
109
-
110
-        if (this.isValidStageViewParticipant(selected)) {
111
-            newSelectedParticipant = selected;
112
-        }
113
-        else {
114
-            newSelectedParticipant = previous.find(isValidStageViewParticipant);
115
-        }
116
-        if (newSelectedParticipant && newSelectedParticipant !== this.selectedParticipant) {
117
-            this.selectedParticipant = newSelectedParticipant;
118
-            return true;
119
-        }
120
-        return false;
121
-    }
122
-
123
-    /**
124
-     * Simple emulation of jitsi-meet's selectParticipants behavior
125
-     */
126
-    selectParticipants() {
127
-        if (!this.connected) {
128
-            return;
129
-        }
130
-        if (stageView) {
131
-            if (this.selectedParticipant) {
132
-                this.room.selectParticipants([this.selectedParticipant]);
133
-            }
134
-        }
135
-        else {
136
-            /* jitsi-meet's current Tile View behavior. */
137
-            const ids = this.room.getParticipants().map(participant => participant.getId());
138
-            this.room.selectParticipants(ids);
139
-        }
140
-    }
141
-
142
-    /**
143
-     * Called when number of participants changes.
144
-     */
145
-    setNumberOfParticipants() {
146
-        if (this.id === 0) {
147
-            $('#participants').text(this.numParticipants);
148
-        }
149
-        if (!stageView) {
150
-            this.selectParticipants();
151
-            this.updateMaxFrameHeight();
152
-        }
153
-        this.updateLastN();
154
-    }
155
-
156
-    /**
157
-     * Called when ICE connects
158
-     */
159
-    onConnectionEstablished() {
160
-        this.connected = true;
161
-
162
-        this.selectParticipants();
163
-        this.updateMaxFrameHeight();
164
-        this.updateLastN();
165
-    }
166
-
167
-    /**
168
-     * Handles dominant speaker changed.
169
-     * @param id
170
-     */
171
-    onDominantSpeakerChanged(selected, previous) {
172
-        if (this.selectStageViewParticipant(selected, previous)) {
173
-            this.selectParticipants();
174
-        }
175
-        this.updateMaxFrameHeight();
176
-    }
177
-
178
-    /**
179
-     * Handles local tracks.
180
-     * @param tracks Array with JitsiTrack objects
181
-     */
182
-    onLocalTracks(tracks = []) {
183
-        this.localTracks = tracks;
184
-        for (let i = 0; i < this.localTracks.length; i++) {
185
-            if (this.localTracks[i].getType() === 'video') {
186
-                if (this.id === 0) {
187
-                    $('body').append(`<video ${autoPlayVideo ? 'autoplay="1" ' : ''}id='localVideo${i}' />`);
188
-                    this.localTracks[i].attach($(`#localVideo${i}`)[0]);
189
-                }
190
-
191
-                this.room.addTrack(this.localTracks[i]);
192
-            } else {
193
-                if (localAudio) {
194
-                    this.room.addTrack(this.localTracks[i]);
195
-                } else {
196
-                    this.localTracks[i].mute();
197
-                }
198
-
199
-                if (this.id === 0) {
200
-                    $('body').append(
201
-                        `<audio autoplay='1' muted='true' id='localAudio${i}' />`);
202
-                    this.localTracks[i].attach($(`#localAudio${i}`)[0]);
203
-                }
204
-            }
205
-        }
206
-    }
207
-
208
-    /**
209
-     * Handles remote tracks
210
-     * @param track JitsiTrack object
211
-     */
212
-    onRemoteTrack(track) {
213
-        if (track.isLocal()
214
-            || (track.getType() === 'video' && !remoteVideo) || (track.getType() === 'audio' && !remoteAudio)) {
215
-            return;
216
-        }
217
-        const participant = track.getParticipantId();
218
-
219
-        if (!this.remoteTracks[participant]) {
220
-            this.remoteTracks[participant] = [];
221
-        }
222
-
223
-        if (this.id !== 0) {
224
-            return;
225
-        }
226
-
227
-        const idx = this.remoteTracks[participant].push(track);
228
-        const id = participant + track.getType() + idx;
229
-
230
-        if (track.getType() === 'video') {
231
-            $('body').append(`<video autoplay='1' id='${id}' />`);
232
-        } else {
233
-            $('body').append(`<audio autoplay='1' id='${id}' />`);
234
-        }
235
-        track.attach($(`#${id}`)[0]);
236
-    }
237
-
238
-    /**
239
-     * That function is executed when the conference is joined
240
-     */
241
-    onConferenceJoined() {
242
-        console.log(`Participant ${this.id} Conference joined`);
243
-    }
244
-
245
-    /**
246
-     * Handles start muted events, when audio and/or video are muted due to
247
-     * startAudioMuted or startVideoMuted policy.
248
-     */
249
-    onStartMuted() {
250
-        // Give it some time, as it may be currently in the process of muting
251
-        setTimeout(() => {
252
-            const localAudioTrack = this.room.getLocalAudioTrack();
253
-
254
-            if (localAudio && localAudioTrack && localAudioTrack.isMuted()) {
255
-                localAudioTrack.unmute();
256
-            }
257
-
258
-            const localVideoTrack = this.room.getLocalVideoTrack();
259
-
260
-            if (localVideo && localVideoTrack && localVideoTrack.isMuted()) {
261
-                localVideoTrack.unmute();
262
-            }
263
-        }, 2000);
264
-    }
265
-
266
-    /**
267
-     *
268
-     * @param id
269
-     */
270
-    onUserJoined(id) {
271
-        this.numParticipants++;
272
-        this.setNumberOfParticipants();
273
-        this.remoteTracks[id] = [];
274
-    }
275
-
276
-    /**
277
-     *
278
-     * @param id
279
-     */
280
-    onUserLeft(id) {
281
-        this.numParticipants--;
282
-        this.setNumberOfParticipants();
283
-        if (!this.remoteTracks[id]) {
284
-            return;
285
-        }
286
-
287
-        if (this.id !== 0) {
288
-            return;
289
-        }
290
-
291
-        const tracks = this.remoteTracks[id];
292
-
293
-        for (let i = 0; i < tracks.length; i++) {
294
-            const container = $(`#${id}${tracks[i].getType()}${i + 1}`)[0];
295
-
296
-            if (container) {
297
-                tracks[i].detach(container);
298
-                container.parentElement.removeChild(container);
299
-            }
300
-        }
301
-    }
302
-
303
-    /**
304
-     * Handles private messages.
305
-     *
306
-     * @param {string} id - The sender ID.
307
-     * @param {string} text - The message.
308
-     * @returns {void}
309
-     */
310
-    onPrivateMessage(id, text) {
311
-        switch (text) {
312
-            case 'video on':
313
-                this.onVideoOnMessage();
314
-                break;
315
-        }
316
-    }
317
-
318
-    /**
319
-     * Handles 'video on' private messages.
320
-     *
321
-     * @returns {void}
322
-     */
323
-    onVideoOnMessage() {
324
-        console.debug(`Participant ${this.id}: Turning my video on!`);
325
-
326
-        const localVideoTrack = this.room.getLocalVideoTrack();
327
-
328
-        if (localVideoTrack && localVideoTrack.isMuted()) {
329
-            console.debug(`Participant ${this.id}: Unmuting existing video track.`);
330
-            localVideoTrack.unmute();
331
-        } else if (!localVideoTrack) {
332
-            JitsiMeetJS.createLocalTracks({ devices: ['video'] })
333
-                .then(([videoTrack]) => videoTrack)
334
-                .catch(console.error)
335
-                .then(videoTrack => {
336
-                    return this.room.replaceTrack(null, videoTrack);
337
-                })
338
-                .then(() => {
339
-                    console.debug(`Participant ${this.id}: Successfully added a new video track for unmute.`);
340
-                });
341
-        } else {
342
-            console.log(`Participant ${this.id}: No-op! We are already video unmuted!`);
343
-        }
344
-    }
345
-
346
-    /**
347
-     * This function is called to connect.
348
-     */
349
-    connect() {
350
-        this._onConnectionSuccess = this.onConnectionSuccess.bind(this)
351
-        this._onConnectionFailed = this.onConnectionFailed.bind(this)
352
-        this._disconnect = this.disconnect.bind(this)
353
-
354
-        this.connection = new JitsiMeetJS.JitsiConnection(null, null, config);
355
-        this.connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED, this._onConnectionSuccess);
356
-        this.connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_FAILED, this._onConnectionFailed);
357
-        this.connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED, this._disconnect);
358
-        this.connection.connect();
359
-    }
360
-
361
-    /**
362
-     * That function is called when connection is established successfully
363
-     */
364
-    onConnectionSuccess() {
365
-        this.room = this.connection.initJitsiConference(roomName.toLowerCase(), config);
366
-        this.room.on(JitsiMeetJS.events.conference.STARTED_MUTED, this.onStartMuted.bind(this));
367
-        this.room.on(JitsiMeetJS.events.conference.TRACK_ADDED, this.onRemoteTrack.bind(this));
368
-        this.room.on(JitsiMeetJS.events.conference.CONFERENCE_JOINED, this.onConferenceJoined.bind(this));
369
-        this.room.on(JitsiMeetJS.events.conference.CONNECTION_ESTABLISHED, this.onConnectionEstablished.bind(this));
370
-        this.room.on(JitsiMeetJS.events.conference.USER_JOINED, this.onUserJoined.bind(this));
371
-        this.room.on(JitsiMeetJS.events.conference.USER_LEFT, this.onUserLeft.bind(this));
372
-        this.room.on(JitsiMeetJS.events.conference.PRIVATE_MESSAGE_RECEIVED, this.onPrivateMessage.bind(this));
373
-        if (stageView) {
374
-            this.room.on(JitsiMeetJS.events.conference.DOMINANT_SPEAKER_CHANGED, this.onDominantSpeakerChanged.bind(this));
375
-        }
376
-
377
-        const devices = [];
378
-
379
-        if (localVideo) {
380
-            devices.push('video');
381
-        }
382
-
383
-        // we always create audio local tracks
384
-        devices.push('audio');
385
-
386
-        if (devices.length > 0) {
387
-            JitsiMeetJS.createLocalTracks({ devices })
388
-                .then(this.onLocalTracks.bind(this))
389
-                .then(() => {
390
-                    this.room.join();
391
-                })
392
-                .catch(error => {
393
-                    throw error;
394
-                });
395
-        } else {
396
-            this.room.join();
397
-        }
398
-
399
-        this.updateMaxFrameHeight();
400
-    }
401
-
402
-    /**
403
-     * This function is called when the connection fail.
404
-     */
405
-    onConnectionFailed() {
406
-        console.error(`Participant ${this.id}: Connection Failed!`);
407
-    }
408
-
409
-    /**
410
-     * This function is called when we disconnect.
411
-     */
412
-    disconnect() {
413
-        console.log('disconnect!');
414
-        this.connection.removeEventListener(
415
-            JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,
416
-            this._onConnectionSuccess);
417
-        this.connection.removeEventListener(
418
-            JitsiMeetJS.events.connection.CONNECTION_FAILED,
419
-            this._onConnectionFailed);
420
-        this.connection.removeEventListener(
421
-            JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,
422
-            this._disconnect);
423
-    }
424
-}
425
-
426
-
427
-let clients = [];
428
-
429
-window.APP = {
430
-    conference: {
431
-        getStats() {
432
-            return clients[0]?.room?.connectionQuality.getStats();
433
-        },
434
-        getConnectionState() {
435
-            return clients[0] && clients[0].room && room.getConnectionState();
436
-        },
437
-        muteAudio(mute) {
438
-            localAudio = mute;
439
-            for (let j = 0; j < clients.length; j++) {
440
-                for (let i = 0; i < clients[j].localTracks.length; i++) {
441
-                    if (clients[j].localTracks[i].getType() === 'audio') {
442
-                        if (mute) {
443
-                            clients[j].localTracks[i].mute();
444
-                        }
445
-                        else {
446
-                            clients[j].localTracks[i].unmute();
447
-                            
448
-                            // if track was not added we need to add it to the peerconnection
449
-                            if (!clients[j].room.getLocalAudioTrack()) {
450
-                                clients[j].room.replaceTrack(null, clients[j].localTracks[i]);
451
-                            }
452
-                        }
453
-                    }
454
-                }
455
-            }
456
-        }
457
-    },
458
-
459
-    get room() {
460
-        return clients[0]?.room;
461
-    },
462
-    get connection() {
463
-        return clients[0]?.connection;
464
-    },
465
-    get numParticipants() {
466
-        return clients[0]?.remoteParticipants;
467
-    },
468
-    get localTracks() {
469
-        return clients[0]?.localTracks;
470
-    },
471
-    get remoteTracks() {
472
-        return clients[0]?.remoteTracks;
473
-    },
474
-    get params() {
475
-        return {
476
-            roomName,
477
-            localAudio,
478
-            localVideo,
479
-            remoteVideo,
480
-            remoteAudio,
481
-            autoPlayVideo,
482
-            stageView
483
-        };
484
-    }
485
-};
486
-
487
-/**
488
- *
489
- */
490
-function unload() {
491
-    for (let j = 0; j < clients.length; j++) {
492
-        for (let i = 0; i < clients[j].localTracks.length; i++) {
493
-            clients[j].localTracks[i].dispose();
494
-        }
495
-        clients[j].room.leave();
496
-        clients[j].connection.disconnect();
497
-    }
498
-    clients = [];
499
-}
500
-
501
-$(window).bind('beforeunload', unload);
502
-$(window).bind('unload', unload);
503
-
504
-JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
505
-
506
-JitsiMeetJS.init(config);
507
-
508
-config.serviceUrl = config.bosh = `${config.websocket || config.bosh}?room=${roomName.toLowerCase()}`;
509
-if (config.websocketKeepAliveUrl) {
510
-    config.websocketKeepAliveUrl += `?room=${roomName.toLowerCase()}`;
511
-}
512
-
513
-function startClient(i) {
514
-    clients[i] = new LoadTestClient(i);
515
-    clients[i].connect();
516
-    if (i + 1 < numClients) {
517
-        setTimeout(() => { startClient(i+1) }, clientInterval)
518
-    }
519
-}
520
-
521
-if (numClients > 0) {
522
-    startClient(0)
523
-}

+ 0
- 15882
resources/load-test/package-lock.json
File diff soppresso perché troppo grande
Vedi File


+ 0
- 56
resources/load-test/package.json Vedi File

@@ -1,56 +0,0 @@
1
-{
2
-  "name": "jitsi-meet-load-test",
3
-  "version": "0.0.0",
4
-  "description": "A load test participant",
5
-  "repository": {
6
-    "type": "git",
7
-    "url": "git://github.com/jitsi/jitsi-meet"
8
-  },
9
-  "keywords": [
10
-    "jingle",
11
-    "webrtc",
12
-    "xmpp",
13
-    "browser"
14
-  ],
15
-  "author": "",
16
-  "readmeFilename": "../README.md",
17
-  "dependencies": {
18
-    "jquery": "3.5.1"
19
-  },
20
-  "devDependencies": {
21
-    "@babel/core": "7.5.5",
22
-    "@babel/plugin-proposal-class-properties": "7.1.0",
23
-    "@babel/plugin-proposal-export-default-from": "7.0.0",
24
-    "@babel/plugin-proposal-export-namespace-from": "7.0.0",
25
-    "@babel/plugin-proposal-nullish-coalescing-operator": "7.4.4",
26
-    "@babel/plugin-proposal-optional-chaining": "7.2.0",
27
-    "@babel/plugin-transform-flow-strip-types": "7.0.0",
28
-    "@babel/preset-env": "7.1.0",
29
-    "@babel/preset-flow": "7.0.0",
30
-    "@babel/runtime": "7.5.5",
31
-    "babel-eslint": "10.0.1",
32
-    "babel-loader": "8.0.4",
33
-    "eslint": "5.6.1",
34
-    "eslint-config-jitsi": "github:jitsi/eslint-config-jitsi#1.0.3",
35
-    "eslint-plugin-flowtype": "2.50.3",
36
-    "eslint-plugin-import": "2.20.2",
37
-    "eslint-plugin-jsdoc": "3.8.0",
38
-    "expose-loader": "0.7.5",
39
-    "flow-bin": "0.104.0",
40
-    "imports-loader": "0.7.1",
41
-    "lodash": "4.17.21",
42
-    "string-replace-loader": "2.1.1",
43
-    "style-loader": "0.19.0",
44
-    "webpack": "4.43.0",
45
-    "webpack-bundle-analyzer": "3.4.1",
46
-    "webpack-cli": "3.3.11"
47
-  },
48
-  "engines": {
49
-    "node": ">=8.0.0",
50
-    "npm": ">=6.0.0"
51
-  },
52
-  "license": "Apache-2.0",
53
-  "scripts": {
54
-    "build": "webpack -p"
55
-  }
56
-}

+ 0
- 131
resources/load-test/webpack.config.js Vedi File

@@ -1,131 +0,0 @@
1
-/* global __dirname */
2
-
3
-const process = require('process');
4
-const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
5
-const analyzeBundle = process.argv.indexOf('--analyze-bundle') !== -1;
6
-const minimize
7
-    = process.argv.indexOf('-p') !== -1
8
-        || process.argv.indexOf('--optimize-minimize') !== -1;
9
-
10
-/**
11
- * Build a Performance configuration object for the given size.
12
- * See: https://webpack.js.org/configuration/performance/
13
- */
14
-function getPerformanceHints(size) {
15
-    return {
16
-        hints: minimize ? 'error' : false,
17
-        maxAssetSize: size,
18
-        maxEntrypointSize: size
19
-    };
20
-}
21
-
22
-// The base Webpack configuration to bundle the JavaScript artifacts of
23
-// jitsi-meet such as app.bundle.js and external_api.js.
24
-const config = {
25
-    devtool: 'source-map',
26
-    mode: minimize ? 'production' : 'development',
27
-    module: {
28
-        rules: [ {
29
-            // Transpile ES2015 (aka ES6) to ES5. Accept the JSX syntax by React
30
-            // as well.
31
-
32
-            exclude: [
33
-                new RegExp(`${__dirname}/node_modules/(?!js-utils)`)
34
-            ],
35
-            loader: 'babel-loader',
36
-            options: {
37
-                // XXX The require.resolve bellow solves failures to locate the
38
-                // presets when lib-jitsi-meet, for example, is npm linked in
39
-                // jitsi-meet.
40
-                plugins: [
41
-                    require.resolve('@babel/plugin-transform-flow-strip-types'),
42
-                    require.resolve('@babel/plugin-proposal-class-properties'),
43
-                    require.resolve('@babel/plugin-proposal-export-default-from'),
44
-                    require.resolve('@babel/plugin-proposal-export-namespace-from'),
45
-                    require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'),
46
-                    require.resolve('@babel/plugin-proposal-optional-chaining')
47
-                ],
48
-                presets: [
49
-                    [
50
-                        require.resolve('@babel/preset-env'),
51
-
52
-                        // Tell babel to avoid compiling imports into CommonJS
53
-                        // so that webpack may do tree shaking.
54
-                        {
55
-                            modules: false,
56
-
57
-                            // Specify our target browsers so no transpiling is
58
-                            // done unnecessarily. For browsers not specified
59
-                            // here, the ES2015+ profile will be used.
60
-                            targets: {
61
-                                chrome: 58,
62
-                                electron: 2,
63
-                                firefox: 54,
64
-                                safari: 11
65
-                            }
66
-
67
-                        }
68
-                    ],
69
-                    require.resolve('@babel/preset-flow'),
70
-                    require.resolve('@babel/preset-react')
71
-                ]
72
-            },
73
-            test: /\.jsx?$/
74
-        }, {
75
-            // Expose jquery as the globals $ and jQuery because it is expected
76
-            // to be available in such a form by multiple jitsi-meet
77
-            // dependencies including lib-jitsi-meet.
78
-
79
-            loader: 'expose-loader?$!expose-loader?jQuery',
80
-            test: /\/node_modules\/jquery\/.*\.js$/
81
-        } ]
82
-    },
83
-    node: {
84
-        // Allow the use of the real filename of the module being executed. By
85
-        // default Webpack does not leak path-related information and provides a
86
-        // value that is a mock (/index.js).
87
-        __filename: true
88
-    },
89
-    optimization: {
90
-        concatenateModules: minimize,
91
-        minimize
92
-    },
93
-    output: {
94
-        filename: `[name]${minimize ? '.min' : ''}.js`,
95
-        path: `${__dirname}/libs`,
96
-        publicPath: 'load-test/libs/',
97
-        sourceMapFilename: `[name].${minimize ? 'min' : 'js'}.map`
98
-    },
99
-    plugins: [
100
-        analyzeBundle
101
-            && new BundleAnalyzerPlugin({
102
-                analyzerMode: 'disabled',
103
-                generateStatsFile: true
104
-            })
105
-    ].filter(Boolean),
106
-    resolve: {
107
-        alias: {
108
-            jquery: `jquery/dist/jquery${minimize ? '.min' : ''}.js`
109
-        },
110
-        aliasFields: [
111
-            'browser'
112
-        ],
113
-        extensions: [
114
-            '.web.js',
115
-
116
-            // Webpack defaults:
117
-            '.js',
118
-            '.json'
119
-        ]
120
-    }
121
-};
122
-
123
-module.exports = [
124
-    Object.assign({}, config, {
125
-        entry: {
126
-            'load-test-participant': './load-test-participant.js'
127
-        },
128
-        performance: getPerformanceHints(3 * 1024 * 1024)
129
-    })
130
-];
131
-

Loading…
Annulla
Salva