Skip to content

Commit 578213c

Browse files
GLStephengpoitch
andauthored
Fix import warning for webpack 5 (prebid#5933)
Webpack 5 emits a warning when importing named exports from json files: ``` "WARNING in ../../node_modules/prebid.js/src/secureCreatives.js 15:16-30 Should not import the named export 'EVENTS'.'BID_WON' (imported as 'EVENTS') from default-exporting module (only default export is available soon)" ``` Co-authored-by: Garth Poitras <[email protected]> Co-authored-by: gpoitch <[email protected]>
1 parent 172df7f commit 578213c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/secureCreatives.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
import events from './events.js';
77
import { fireNativeTrackers, getAssetMessage } from './native.js';
8-
import { EVENTS } from './constants.json';
8+
import constants from './constants.json';
99
import { logWarn, replaceAuctionPrice } from './utils.js';
1010
import { auctionManager } from './auctionManager.js';
1111
import find from 'core-js-pure/features/array/find.js';
1212
import { isRendererRequired, executeRenderer } from './Renderer.js';
1313
import includes from 'core-js-pure/features/array/includes.js';
1414

15-
const BID_WON = EVENTS.BID_WON;
15+
const BID_WON = constants.EVENTS.BID_WON;
1616

1717
export function listenMessagesFromCreative() {
1818
window.addEventListener('message', receiveMessage, false);

0 commit comments

Comments
 (0)