How to use the systemjs.normalize function in systemjs

To help you get started, we’ve selected a few systemjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DDMAL / musiclibs / misirlou / frontend / scripts / bundle.js View on Github external
function normalizeProduction()
{
    // FIXME: Testing the file path is kind of expensive. This should be
    // cached, and files in js/packages shouldn't be tested

    return System.normalize.apply(this, arguments).then(function (result)
    {
        var resultPath = getAbsolutePathFromFileURL(result);

        if (resultPath === null)
            return result;

        var basename = path.basename(resultPath);
        var productionized = basename.replace(/^(.*)(\.[^.]+)$/, '$1.production$2');

        // Bail if deriving the production name failed
        if (productionized === basename)
            return result;

        var productionPath = path.join(path.dirname(resultPath), productionized);

        // Test the path and return resolve with the productionized version if it