_bundleDocument(docBundle, bundleManifest) {
        return __awaiter(this, void 0, void 0, function* () {
            let document = yield this._prepareBundleDocument(docBundle);
            const ast = clone(document.parsedDocument.ast);
            dom5.removeFakeRootElements(ast);
            this._injectHtmlImportsForBundle(document, ast, docBundle, bundleManifest);
            importUtils.rewriteAstToEmulateBaseTag(ast, document.url, this.rewriteUrlsInTemplates);
            // Re-analyzing the document using the updated ast to refresh the scanned
            // imports, since we may now have appended some that were not initially
            // present.
            document = yield this._analyzeContents(document.url, parse5_1.serialize(ast));
            // The following set of operations manipulate the ast directly, so
            yield this._inlineHtmlImports(document, ast, docBundle, bundleManifest);
            if (this.enableScriptInlining) {
                yield this._inlineScripts(document, ast, docBundle, this.excludes);
            }
            if (this.enableCssInlining) {
                yield this._inlineStylesheetLinks(document, ast, docBundle, this.excludes, this.rewriteUrlsInTemplates);
                yield this._inlineStylesheetImports(document, ast, docBundle, this.excludes, this.rewriteUrlsInTemplates);
            }
            if (this.stripComments) {
                astUtils.stripComments(ast);
            }
            this._removeEmptyHiddenDivs(ast);
            if (this.sourcemaps) {
                return source_map_1.updateSourcemapLocations(document, ast);
            }
            else {
                return ast;
            }
        });
    }
/**
     * Produces a document containing the content of all of the bundle's files.
     * If the bundle's url resolves to an existing html file, that file will be
     * used as the basis for the generated document.
     */
Produces a document containing the content of all of the bundle's files.
If the bundle's url resolves to an existing html file, that file will be
used as the basis for the generated document.
Produces a document containing the content of all of the bundle ' s files . If the bundle ' s url resolves to an existing html file that file will be used as the basis for the generated document .
_bundleDocument(docBundle, bundleManifest) {
        return __awaiter(this, void 0, void 0, function* () {
            let document = yield this._prepareBundleDocument(docBundle);
            const ast = clone(document.parsedDocument.ast);
            dom5.removeFakeRootElements(ast);
            this._injectHtmlImportsForBundle(document, ast, docBundle, bundleManifest);
            importUtils.rewriteAstToEmulateBaseTag(ast, document.url, this.rewriteUrlsInTemplates);
            document = yield this._analyzeContents(document.url, parse5_1.serialize(ast));
            yield this._inlineHtmlImports(document, ast, docBundle, bundleManifest);
            if (this.enableScriptInlining) {
                yield this._inlineScripts(document, ast, docBundle, this.excludes);
            }
            if (this.enableCssInlining) {
                yield this._inlineStylesheetLinks(document, ast, docBundle, this.excludes, this.rewriteUrlsInTemplates);
                yield this._inlineStylesheetImports(document, ast, docBundle, this.excludes, this.rewriteUrlsInTemplates);
            }
            if (this.stripComments) {
                astUtils.stripComments(ast);
            }
            this._removeEmptyHiddenDivs(ast);
            if (this.sourcemaps) {
                return source_map_1.updateSourcemapLocations(document, ast);
            }
            else {
                return ast;
            }
        });
    }
_bundleDocument ( docBundle , bundleManifest ) { return __awaiter ( this , void 0 , void 0 , function * ( ) { let document = yield this . _prepareBundleDocument ( docBundle ) ; const ast = clone ( document . parsedDocument . ast ) ; dom5 . removeFakeRootElements ( ast ) ; this . _injectHtmlImportsForBundle ( document , ast , docBundle , bundleManifest ) ; importUtils . rewriteAstToEmulateBaseTag ( ast , document . url , this . rewriteUrlsInTemplates ) ; document = yield this . _analyzeContents ( document . url , parse5_1 . serialize ( ast ) ) ; yield this . _inlineHtmlImports ( document , ast , docBundle , bundleManifest ) ; if ( this . enableScriptInlining ) { yield this . _inlineScripts ( document , ast , docBundle , this . excludes ) ; } if ( this . enableCssInlining ) { yield this . _inlineStylesheetLinks ( document , ast , docBundle , this . excludes , this . rewriteUrlsInTemplates ) ; yield this . _inlineStylesheetImports ( document , ast , docBundle , this . excludes , this . rewriteUrlsInTemplates ) ; } if ( this . stripComments ) { astUtils . stripComments ( ast ) ; } this . _removeEmptyHiddenDivs ( ast ) ; if ( this . sourcemaps ) { return source_map_1 . updateSourcemapLocations ( document , ast ) ; } else { return ast ; } } ) ; }
Produces a document containing the content of all of the bundle's files.
Produces a document containing the content of all of the bundle ' s files .
// Re-analyzing the document using the updated ast to refresh the scanned // imports, since we may now have appended some that were not initially // present. // The following set of operations manipulate the ast directly, so