I am writing an Aurelia template file and I want to add a comment to it. This is a comment that I want people who read the template file (i.e. my fellow developers) to see. However, I want it to be stripped out upon compilation - I don't want end-users of the web site to be able to inspect the page source and see the text of the comment when they visit the site. How is this done? An ordinary HTML comment (<!-- ... -->) is not stripped out.
What I have tried already
I ctrl-F'd this page: http://aurelia.io/docs/templating/basics for the word "comment". There were zero matches, so if that page provides an answer, it does so without using the word "comment".
After creating a project with
aurelia-cli(in my case TS with Webpack)You may have any template file (
.html) containing something likethen, to remove the comment/s once compiled (always/conditionally)
webpack.config.jsmodulefindrulesarrayhtml-loadersectionminimizevalue totrueor base it on build-typeproductionetcminimizeaccepts the following typethereby enabling finer control.
To read more about it: https://webpack.js.org/loaders/html-loader/#minimize