Skip to content

Commit

Permalink
allow globalVarName as babel plugin option (#3491)
Browse files Browse the repository at this point in the history
  • Loading branch information
snapwich authored and jaiminpanchal27 committed Jan 29, 2019
1 parent 4123ea6 commit 88cca59
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions plugins/pbjsGlobals.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
let t = require('@babel/core').types;
let prebid = require('../package.json');

let replace = {
'$prebid.version$': prebid.version,
'$$PREBID_GLOBAL$$': prebid.globalVarName,
'$$REPO_AND_VERSION$$': `${prebid.repository.url.split('/')[3]}_prebid_${prebid.version}`
};
module.exports = function(api, options) {
let replace = {
'$prebid.version$': prebid.version,
'$$PREBID_GLOBAL$$': options.globalVarName || prebid.globalVarName,
'$$REPO_AND_VERSION$$': `${prebid.repository.url.split('/')[3]}_prebid_${prebid.version}`
};

let identifierToStringLiteral = [
'$$REPO_AND_VERSION$$'
];
let identifierToStringLiteral = [
'$$REPO_AND_VERSION$$'
];

module.exports = function() {
return {
visitor: {
StringLiteral(path) {
Expand Down

0 comments on commit 88cca59

Please sign in to comment.