Search code examples
extjsextjs6.2

ExtJS 6 app.js does not updates after new production release


We are using Extjs 6 and we are using sencha cmd to build our application.

We are facing one issue. Every time we release production version of our application like 6.3 to 6.4, bundled app.js does not get updated and browser take that file from (from disk cache). So every time we have to tell our users that please clear your browser's cache after you got new release. That's annoying.

This is my app.json file.

"output": {
        "base": "${workspace.build.dir}/${build.environment}/${app.name}",
        "page": "index.html",
        "manifest": "${build.id}.json",
        "js": "${build.id}/.js",
        "appCache": {
            "enable": false,
            "update": "full"
        },
        "resources": {
            "path": "${build.id}/resources",
            "shared": "resources"
        }
    },
"production": {
        "output": {
            "appCache": {
                "enable": false,
                "path": "cache.appcache"
            }
        },
......
"cache": {
            "enable": false 
        }
...

Solution

  • I have found solution:

    "js": [
            {
                "path": "app.js",
                "bundle": true,
                "includeInBundle": false
            }
        ],
    .....
    "output": {
            "base": "${workspace.build.dir}/${build.environment}/${app.name}",
            "page": "index.html",
            "manifest": "${build.id}.json",
            "js": "${build.id}/app_${app.version}.js",
            "appCache": {
                "enable": false,
                "update": "full"
            },
            "resources": {
                "path": "${build.id}/resources",
                "shared": "resources"
            }
        },
    ....
    

    This will not include app.js file in production build and create new app.js file with version appended at last to it like: app_6.4.js.