Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (
pathM.node.object.name === '__webpack_require__' &&
pathM.node.property.name === 'p'
) {
pathM.replaceWith(StringLiteral(publicPath)); // eslint-disable-line
}
},
});
},
});
}
},
});
}
return traverse.removeProperties(expr);
};
function generateAstFromTemplateString(input) {
var parsed = babylon.parse(`\`${input}\``, parseOptions);
var ast = traverse.removeProperties(parsed, { preserveComments: parseOptions.preserveComments });
return ast.program.body[0].expression;
}