I want to create a module for CMS using Rollup or webpack.
I have a script tag that contains a few variables which I need to use in my webpack module, but I can’t include them directly because these render on the server-side.
I tried to use the globals section in the rollup config, but I’m not sure if this is the right way.
The tag script with the variables:
<script>
var dle_root = '/';
var dle_admin = '';
var dle_login_hash = '{HASH}';
var dle_group = 5;
var dle_skin = 'testskin';
var dle_wysiwyg = '2';
var quick_wysiwyg = '2';
var dle_min_search = '3';
</script>
How to define external variables in Rollup or webpack?
How to do it correct?