How to inject different config values inside of my app.js file for things like URLs?



When a user clicks on a button I want to redirect to a URL, but this URL has to be read from my config since it varies between DEV and PROD environments.

Is this possible to do with webpack somehow?

  window.location.href = 'http://localhost:4000/accounts/new';
  return false;


Can’t you use data-attributes to save the URL?


Oh I see what your saying, that’s one approach yes thanks.