Y
Y
Yuri Kalnin2019-04-01 16:29:32
JavaScript
Yuri Kalnin, 2019-04-01 16:29:32

SystemJS how to change the version of the included file?

Please tell me how to change the versions of the included files? For example, I update the ts code, but in order for it to work, you need to press ctrl + f5. Need an analogue of script.js?v=1 only here:

SystemJS.config({
        baseURL: "{{ asset('assets/quizwidget/build/js') }}",
        packages: {
            "/": { defaultExtension: "js" }
        }
    });
    System.import("constructor.js");

I try like this:
System.config({

        baseURL: "{{ asset('assets/quizwidget/build/js') }}",
        packages: {
            "/": { defaultExtension: "js" }
        }
    });

    var buildNumber = 1234, // made your own build number
        systemLocate = System.locate;
    System.locate = function(load) {
        console.log(11)
        return Promise.resolve(systemLocate.call(this, load)).then(function(address) {
            console.log(22)
            return address + '?build='+buildNumber;
        });
    }

    System.import("constructor.js");

does not work, the files are still connected obsolete

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question