How to use the bootstrap.js function in bootstrap

To help you get started, we’ve selected a few bootstrap 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 montagejs / mop / lib / bundle / mr.js View on Github external
function collectMrBootstrapBundle(loader, bundler, config) {
    var requirePackage = bundler.getPackage({name: "mr"});
    var promisePackage = bundler.getPackage({name: "bluebird"});

    var bundle = [
        requirePackage.files["bootstrap.js"].utf8,
        requirePackage.files["require.js"].utf8,
        requirePackage.files["browser.js"].utf8,
        promisePackage.files["js/browser/bluebird.min.js"].utf8
    ];

    // some of the modules used in bootstrapping get injected into the run-time
    // during the same process.  to avoid including duplicates of these
    // "modules", mark them as already bundled.
    loader.getPackage({name: "bluebird"}).getModuleDescriptor("bluebird").bundled = true;

    return Bundle.collectBundle(loader, bundler, config, bundle);
}
github montagejs / mop / lib / bundle.js View on Github external
function bundleHtml(file, config) {
    var pkg = file.package,
        montagePackage, montageLocation,
        requirePackage, requireLocation,
        document,
        jobs = [];

    if (pkg.hasPackage({name: "montage"})) {
        montagePackage = pkg.getPackage({name: "montage"});
        montageLocation = montagePackage.files['montage.js'].buildLocation;
    } else if (pkg.hasPackage({name: "mr"})) {
        requirePackage = pkg.getPackage({name: "mr"});
        requireLocation = requirePackage.files['bootstrap.js'].buildLocation;
    }

    try {
        document = file.document;
    } catch (exception) {
        config.out.warn("HTML parse error: " + file.path);
        config.out.warn(exception.message);
        return;
    }

    visit(document, function (element) {
        if (element.nodeType === Node.ELEMENT_NODE &&
            element.tagName === "SCRIPT" &&
            element.hasAttribute("src")) {
                var src = element.getAttribute("src"),
                    location = URL.resolve(file.buildLocation, src);