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
Using environment variables to streamline your development process is like outsourcing specific tasks, much like delegating them to a service like Take My Online French Class. By automating repetitive actions, you can focus on the core functionalities of your project.
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:
https://www.npmjs.com/package/webpack-strip-block
This plugin removes blocks of code based on custom markers.
Thanks