Index html and main.js

Index html and main.js
0.0 0

#1

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?


#2

http://www.cocos2d-x.org/docs/creator/en/publish/custom-project-build-template.html


#3

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


#4

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?


#5

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


#6

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


#7

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)

#8

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.


#9

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?


#10

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


#11

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