Cocos2D-JS - Compile and run the Clean build?

Context:
I am creating a Cocos2d-JS game. I have already created a project and at the development stage.

I can run cocos run -p webeither cocos run -p web --source-mapfrom the project directory in the console. These commands work and allow me to run and test my project.


Problem:
Simple: the code changes that I do are not collected by the cocos2d-JSB compiler. The old code that I recently changed still exists in recently compiled cocos2d projects. I cannot detect the changes that I have made to class files that have already been compiled.


Technical:
Problem technically: Modified .js files are not copied correctly by cocos2d-js compiler (from terminal / console). The previous version of the .js file is saved somehow on the localhost-web server. The local host is supported by a Python script that launches the cocos2d application.

(I write most of my code using Typescript .tsand compiling down in Javascript .jswith .js.map. I definitely compiled down Typescript to Javascript before starting the Coconut compiler)


More:
I see that my .ts files are visible from localhost when using the Javascript Console in Chrome browser. I can also see my .js files this way and I can confirm that the code is not updated.


:
cocos compile cocos run .js "" ?

, --source-map run ?

"Clean Build", Apple Xcode, cocos2d-js. ?

, /, , .js?

+4
4

:.js .

:
Chrome .js. , . , localhost .


: Chrome:
( ) → → → ( Gear) → ( DevTools )

+7

, Chrome .
, , js, .

- - , - .

0

Yes, it was that simple, just open the developer tools with F12, then go to settings, make a cache file, and when you start the game, activate the dev tools (F12) again and refresh the page

0
source

You can set noCache to true in the project.json file if you no longer want to cache

Here is a sample code.

    {
      "project_type": "javascript",
      "debugMode": 1,
      "showFPS": false,
      "frameRate": 60,
      "noCache": true,
      "id": "gameCanvas",
      "renderMode":1,
      "engineDir": "frameworks/cocos2d-html5",
      "modules": [
        "cocos2d",
        "cocostudio",
        "editbox"
      ],
0
source

Source: https://habr.com/ru/post/1540889/


All Articles