Custom build-templates parameters

When I create e.g. [project_root]/build-templates/web-mobile/index.html and use the default index.html file that contains <title><%=project%></title> and many other parameters that automatically will be filled in in the build process. Same applies for main.js containing these parameters.

How can I get them to work while having my custom build-template?

Can I somehow create custom properties for the build (e.g. environment variables) or how can you apply environment variables for builds?

Can I affect the Cocos Creator development environment template somehow the same way?

I would really appreciate any help I can get on this one. Thank you! :slight_smile:

1 Like

If any developer or other person knows anything about this it would be nice to know. A “No it doesn’t work” answer is also good and would save time to not have to put in the time for research.
Thanks a lot for your help!

Share your finding!

I haven’t spent more time on this since posting it here. A simple “yes/no” answer from developers could save hours of research!

Please someone who knows, let us know! :slightly_smiling_face:

If I understand right - whole files - index.html, main.js, etc. - are parameters that you meant. Feel free to customize them like you want

Yes, that is true, but I’m now talking about the Cocos build variables such as <%project%>, they don’t work in the custom template for some reason

By far, you should not use <% *** %>, it’s source templates we use internally. You can copy the formatted main.js from the file after building.