From 840f9b711612342fed2559f4e66d4d1e6a754ac1 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 26 Jan 2022 12:32:33 -0300 Subject: [PATCH] fix: implement local pbjsGlobals.js --- config/pbjsGlobals.js | 2 +- webpack.config.js | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/config/pbjsGlobals.js b/config/pbjsGlobals.js index 6aa9ff57..45ef41f0 100644 --- a/config/pbjsGlobals.js +++ b/config/pbjsGlobals.js @@ -1,6 +1,6 @@ let t = require('@babel/core').types; -let prebid = require('../package.json'); +let prebid = require('prebid.js/package.json'); const path = require('path'); module.exports = function(api, options) { diff --git a/webpack.config.js b/webpack.config.js index 8798c016..d37b9798 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,7 +8,6 @@ */ const fs = require( 'fs' ); const getBaseWebpackConfig = require( 'newspack-scripts/config/getWebpackConfig' ); -const prebidConfig = require( 'prebid.js/.babelrc.js' ); const path = require( 'path' ); /** @@ -69,7 +68,19 @@ webpackConfig.module.rules.push( { // presets and plugins for Prebid.js must be manually specified separate from your other babel rule. // this can be accomplished by requiring prebid's .babelrc.js file (requires Babel 7 and Node v8.9.0+) options: { - ...prebidConfig, + presets: [ + [ + require.resolve( '@babel/preset-env' ), + { + useBuiltIns: 'entry', + corejs: 3.6, + }, + ], + ], + plugins: [ + require.resolve( './config/pbjsGlobals.js' ), + require.resolve( 'babel-plugin-transform-object-assign' ), + ], configFile: false, }, },