Skip to content

Commit

Permalink
fix: implement local pbjsGlobals.js
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpeixe committed Jan 26, 2022
1 parent 2e42f5a commit 840f9b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/pbjsGlobals.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
15 changes: 13 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

/**
Expand Down Expand Up @@ -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,
},
},
Expand Down

0 comments on commit 840f9b7

Please sign in to comment.