1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | import { PackageRelativeUrl } from 'polymer-analyzer';
|
16 | import { ProjectConfig, ProjectOptions } from 'polymer-project-config';
|
17 | import { BuildAnalyzer } from './analyzer';
|
18 | import { BuildBundler, Options as BuildBundlerOptions } from './bundle';
|
19 | import { LocalFsPath } from './path-transformers';
|
20 | export declare class PolymerProject {
|
21 | config: ProjectConfig;
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 | analyzer: BuildAnalyzer;
|
28 | constructor(config: ProjectConfig | ProjectOptions | string);
|
29 | /**
|
30 | * Returns a `Transform` stream that modifies the files that pass through it
|
31 | * based on the dependency analysis done by the `analyzer` transform. It
|
32 | * "bundles" a project by injecting its dependencies into the application
|
33 | * fragments themselves, so that a minimum number of requests need to be made
|
34 | * to load.
|
35 | *
|
36 | * (NOTE: The analyzer stream must be in the pipeline somewhere before this.)
|
37 | */
|
38 | bundler(options?: BuildBundlerOptions): BuildBundler;
|
39 | /**
|
40 | * Returns the analyzer's stream of this project's source files - files
|
41 | * matched by the project's `config.sources` value.
|
42 | */
|
43 | sources(): NodeJS.ReadableStream;
|
44 | /**
|
45 | * Returns the analyzer's stream of this project's dependency files - files
|
46 | * loaded inside the analyzed project that are not considered source files.
|
47 | */
|
48 | dependencies(): NodeJS.ReadableStream;
|
49 | /**
|
50 | * Returns a stream transformer that injects 'prefetch' link tags into HTML
|
51 | * documents based on the transitive dependencies of the document.
|
52 | * For entrypoint documents without `<base>` tag, absolute urls are used in
|
53 | * prefetch link hrefs. In all other cases, link hrefs will be relative urls.
|
54 | */
|
55 | addPrefetchLinks(): NodeJS.ReadWriteStream;
|
56 | /**
|
57 | * Returns a stream transformer that adds a push manifest file to the set
|
58 | * of all input files that pass through.
|
59 | */
|
60 | addPushManifest(outPath?: LocalFsPath, basePath?: PackageRelativeUrl): NodeJS.ReadWriteStream;
|
61 | /**
|
62 | * Returns a stream transformer that injects `custom-elements-es5-adapter.js`
|
63 | * into the entry point HTML file. This adapter is needed when serving ES5
|
64 | * to browsers that support the native Custom Elements API.
|
65 | */
|
66 | addCustomElementsEs5Adapter(): NodeJS.ReadWriteStream;
|
67 | addBabelHelpersInEntrypoint(entrypoint?: string): NodeJS.ReadWriteStream;
|
68 | /**
|
69 | * Return a stream transformer that updates the `<base>` tag of the project's
|
70 | * entrypoint HTML file with the given new value. No change is made if a
|
71 | * `<base>` tag does not already exist.
|
72 | */
|
73 | updateBaseTag(baseHref: string): NodeJS.ReadWriteStream;
|
74 | }
|