Webpack and JavaScript replace parts of code with placeholders

hello everyone, I have a question.
do you know how I can replace values of my JS Script with placeholder.
For example in my Entry:

let JSON_URL  =  'https://example-link.com';

And when I run the command npm run build the output would be this:

let JSON_URL = '#{A_JSON_URL}';

I’m just a beginner in Webpack and I only know the basics, can someone help me? I don’t have the slightest idea how to do this. …

I haven’t written a transformer, but I have written custom linter rules, which use some of the same tools. I’d recommend looking up youtube, “custom babel transform”.

1 Like

Thank you @kevinSmith

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.