Custom build-templates parameters

Custom build-templates parameters
0.0 0

#1

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:


Feedback: master volume, project-based build template, time scale
#2

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!


#3

Share your finding!


#4

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:


#5

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


#6

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


#7

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.