本文整理匯總了TypeScript中polymer-analyzer.Analyzer._fork方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Analyzer._fork方法的具體用法?TypeScript Analyzer._fork怎麽用?TypeScript Analyzer._fork使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類polymer-analyzer.Analyzer
的用法示例。
在下文中一共展示了Analyzer._fork方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(options?: Options) {
const opts = options ? options : {};
// In order for the bundler to use a given analyzer, we'll have to fork it
// so we can provide our own overlayUrlLoader which falls back to the
// analyzer's load method.
if (opts.analyzer) {
const analyzer = opts.analyzer;
this._overlayUrlLoader = new InMemoryOverlayUrlLoader(analyzer);
this.analyzer = analyzer._fork({urlLoader: this._overlayUrlLoader});
} else {
this._overlayUrlLoader =
new InMemoryOverlayUrlLoader(new FsUrlLoader(resolvePath('.')));
this.analyzer = new Analyzer({urlLoader: this._overlayUrlLoader});
}
this.excludes = Array.isArray(opts.excludes) ? opts.excludes : [];
this.stripComments = Boolean(opts.stripComments);
this.enableCssInlining =
opts.inlineCss === undefined ? true : opts.inlineCss;
this.enableScriptInlining =
opts.inlineScripts === undefined ? true : opts.inlineScripts;
this.rewriteUrlsInTemplates = Boolean(opts.rewriteUrlsInTemplates);
this.sourcemaps = Boolean(opts.sourcemaps);
this.strategy =
opts.strategy || bundleManifestLib.generateSharedDepsMergeStrategy();
this.urlMapper = opts.urlMapper ||
bundleManifestLib.generateCountingSharedBundleUrlMapper(
this.analyzer.resolveUrl('shared_bundle_')!);
}