Rollup plugin designed mainly for use with node-config (though you can pass any object you want).
Install the package:
npm install --save-dev rollup-plugin-config
yarn add --dev rollup-plugin-config
Pass any object with a single root node to the plugin (it can be named anything you want).
const configObject =one: 1two: 2three:four: 'four';
Use that node name as a global variable in your script.
It'll get replaced with an actual value from the object you provided.