1 | import Analyzer, { Import } from './analyzer';
|
2 | import Package from './package';
|
3 | import BundleConfig from './bundle-config';
|
4 | export interface ResolvedImport {
|
5 | specifier: string;
|
6 | entrypoint: string;
|
7 | importedBy: Import[];
|
8 | }
|
9 | export interface BundleDependencies {
|
10 | staticImports: ResolvedImport[];
|
11 | dynamicImports: ResolvedImport[];
|
12 | }
|
13 | export interface SplitterOptions {
|
14 | bundles: BundleConfig;
|
15 | analyzers: Map<Analyzer, Package>;
|
16 | }
|
17 | export default class Splitter {
|
18 | private options;
|
19 | private lastImports;
|
20 | private lastDeps;
|
21 | private packageVersions;
|
22 | constructor(options: SplitterOptions);
|
23 | deps(): Promise<Map<string, BundleDependencies>>;
|
24 | private importsChanged;
|
25 | private computeTargets;
|
26 | private versionOfPackage;
|
27 | private assertSafeVersion;
|
28 | private computeDeps;
|
29 | private sortDependencies;
|
30 | private sortBundle;
|
31 | private chooseBundle;
|
32 | private bundleForPath;
|
33 | }
|