Changing the javascript compilation based on env vars
I want to make sections and blocks that if my javascript is wrapped with
START_TEST_CODE
.... javascript code
END_TEXT_CODE
if a env var is set to specific string it will remove all those lines of code from the compiled javascript
I am using metronic HTML
Replies (1)
Deleted comment
Deleted comment
Hi Yoav Shaharabani
To handle conditional JavaScript removal based on environment variables, a custom build step with a tool like Babel, Webpack, or Gulp would work well.
You can use webpack-strip-block and check their documentation site:
This plugin removes blocks of code based on custom markers.
Thanks