2

We are now going to production and are noticing the jss build and jss deploy files are not updating the hash on the file names when the content changes. This is causing cache busting to not work and end users are not able to see any updates without going to incognito or clearing all their cache. Below is our angular.json file

{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
    "org": {
        "root": "",
        "sourceRoot": "src",
        "projectType": "application",
        "architect": {
            "build": {
                "builder": "@angular-devkit/build-angular:browser",
                "options": {
                    "outputPath": "dist/browser/",
                    "index": "src/index.html",
                    "main": "src/main.ts",
                    "tsConfig": "src/tsconfig.app.json",
                    "polyfills": "src/polyfills.ts",
                    "assets": [
                        "src/assets",
                        "src/favicon.ico"
                    ],
                    "styles": [
                        "src/styles.scss",
                        "src/assets/sass/themes/ih-main-light/ih-main-light.scss"

                    ],
                    "scripts": []
                },
                "configurations": {
                    "production": {
                        "optimization": true,
                        "outputHashing": "all",
                        "sourceMap": false,
                        "extractCss": true,
                        "namedChunks": false,
                        "aot": true,
                        "extractLicenses": true,
                        "vendorChunk": false,
                        "buildOptimizer": true,
                        "fileReplacements": [{
                                "replace": "src/environments/environment.ts",
                                "with": "src/environments/environment.prod.ts"
                            }, {
                                "replace": "src/index.html",
                                "with": "src/index.prod.html"
                            }
                        ]
                    }
                }
            },
            "serve": {
                "builder": "@angular-devkit/build-angular:dev-server",
                "options": {
                    "browserTarget": "org:build",
                    "port": 3000,
                    "proxyConfig": "proxy.conf.js"
                },
                "configurations": {
                    "production": {
                        "browserTarget": "org:build:production"
                    }
                }
            },
            "extract-i18n": {
                "builder": "@angular-devkit/build-angular:extract-i18n",
                "options": {
                    "browserTarget": "org:build"
                }
            },
            "test": {
                "builder": "@angular-devkit/build-angular:karma",
                "options": {
                    "main": "src/test.ts",
                    "karmaConfig": "./karma.conf.js",
                    "polyfills": "src/polyfills.ts",
                    "tsConfig": "src/tsconfig.spec.json",
                    "scripts": [],
                    "styles": [
                        "src/styles.scss"
                    ],
                    "assets": [
                        "src/assets",
                        "src/favicon.ico"
                    ]
                }
            },
            "lint": {
                "builder": "@angular-devkit/build-angular:tslint",
                "options": {
                    "tsConfig": [
                        "src/tsconfig.app.json",
                        "src/tsconfig.spec.json"
                    ],
                    "exclude": [
                        "**/node_modules/**"
                    ]
                }
            },
            "server": {
                "builder": "@angular-devkit/build-angular:server",
                "options": {
                    "outputPath": "dist/server",
                    "main": "src/main.server.ts",
                    "tsConfig": "src/tsconfig.server.json"
                }
            }
        }
    },
    "org-e2e": {
        "root": "",
        "sourceRoot": "",
        "projectType": "application",
        "architect": {
            "e2e": {
                "builder": "@angular-devkit/build-angular:protractor",
                "options": {
                    "protractorConfig": "./protractor.conf.js",
                    "devServerTarget": "org:serve"
                }
            },
            "lint": {
                "builder": "@angular-devkit/build-angular:tslint",
                "options": {
                    "tsConfig": [
                        "e2e/tsconfig.e2e.json"
                    ],
                    "exclude": [
                        "**/node_modules/**"
                    ]
                }
            }
        }
    }
},
"defaultProject": "org",
"schematics": {
    "@schematics/angular:component": {
        "prefix": "app",
        "styleext": "scss"
    },
    "@schematics/angular:directive": {
        "prefix": "app"
    }
}

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.