Index html and main.js

Index html and main.js
0.0 0


Hi, if I I want to use my own modified index.html or main.js what should I do? I create one and put in the project dir but it doesnt affect to the project when I run. Are they always generating during the build?



Thanks man, I am a bit ashamed of that we have it in docs and I asked this question :slight_smile:


Hi, I noticed that I have to create a build to start using my index.html with that build-template. Is there a way to modify the index.html in play mode?


You can access and manipulate the DOM from anywhere in code if that’s what you want.


Actually I would prefer to have my index.html in play mode. Is there a way to overwrite the default one?


You can find in default templates folder of Cocos Creator:

[Windows] C:\CocosCreator\resources\static

For play mode:

[Windows] C:\CocosCreator\resources\static\preview-templates
[Windows] C:\CocosCreator\resources\static\preview-templates\index.jade (index.html)


It would actually be pretty awesome if we could define our own template per project for the editor live build. Or if the editor would just use the build template the same way an actual build game would.


And what do you think, shall we have that feature in close future? Or we should go ahead with this not straightforward workaround with changing the default in static folder?


That you would probably have to ask the Cocos team about.


This would be awesome and make so much sense to have, in my opinion. :slightly_smiling_face: