@rsdoctor/graph 1.2.2 → 1.2.4-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{type/graph → graph}/chunk-graph/asset.d.ts +0 -1
- package/dist/{type/graph → graph}/chunk-graph/chunk.d.ts +0 -1
- package/dist/{type/graph → graph}/chunk-graph/entrypoint.d.ts +0 -1
- package/dist/{type/graph → graph}/chunk-graph/graph.d.ts +0 -1
- package/dist/{type/graph → graph}/chunk-graph/index.d.ts +0 -1
- package/dist/{type/graph → graph}/index.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/dependency.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/graph.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/index.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/module.d.ts +1 -2
- package/dist/{type/graph → graph}/module-graph/statement.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/tree-shaking/export.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/tree-shaking/index.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/tree-shaking/module.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/tree-shaking/sideEffect.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/tree-shaking/types.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/tree-shaking/variable.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/types.d.ts +0 -1
- package/dist/{type/graph → graph}/module-graph/utils.d.ts +0 -1
- package/dist/{type/graph → graph}/package-graph/dependency.d.ts +0 -1
- package/dist/{type/graph → graph}/package-graph/graph.d.ts +0 -1
- package/dist/{type/graph → graph}/package-graph/index.d.ts +0 -1
- package/dist/{type/graph → graph}/package-graph/package.d.ts +0 -1
- package/dist/{type/graph → graph}/package-graph/types.d.ts +0 -1
- package/dist/{type/graph → graph}/package-graph/utils.d.ts +0 -1
- package/dist/index.cjs +1541 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1452 -0
- package/dist/transform/chunks/assetsContent.d.ts +4 -0
- package/dist/transform/chunks/assetsModules.d.ts +22 -0
- package/dist/transform/chunks/chunkTransform.d.ts +5 -0
- package/dist/transform/chunks/index.d.ts +3 -0
- package/dist/transform/index.d.ts +4 -0
- package/dist/transform/module-graph/compatible.d.ts +8 -0
- package/dist/transform/module-graph/index.d.ts +3 -0
- package/dist/transform/module-graph/transform.d.ts +7 -0
- package/dist/transform/module-graph/utils.d.ts +13 -0
- package/dist/transform/trans-utils/index.d.ts +1 -0
- package/dist/transform/trans-utils/transStats.d.ts +10 -0
- package/dist/transform/webpack/compatible.d.ts +16 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/transform.d.ts +6 -0
- package/package.json +18 -9
- package/dist/cjs/graph/chunk-graph/asset.js +0 -72
- package/dist/cjs/graph/chunk-graph/chunk.js +0 -121
- package/dist/cjs/graph/chunk-graph/entrypoint.js +0 -73
- package/dist/cjs/graph/chunk-graph/graph.js +0 -109
- package/dist/cjs/graph/chunk-graph/index.js +0 -87
- package/dist/cjs/graph/index.js +0 -78
- package/dist/cjs/graph/module-graph/dependency.js +0 -100
- package/dist/cjs/graph/module-graph/graph.js +0 -319
- package/dist/cjs/graph/module-graph/index.js +0 -105
- package/dist/cjs/graph/module-graph/module.js +0 -328
- package/dist/cjs/graph/module-graph/statement.js +0 -92
- package/dist/cjs/graph/module-graph/tree-shaking/export.js +0 -102
- package/dist/cjs/graph/module-graph/tree-shaking/index.js +0 -96
- package/dist/cjs/graph/module-graph/tree-shaking/module.js +0 -100
- package/dist/cjs/graph/module-graph/tree-shaking/sideEffect.js +0 -89
- package/dist/cjs/graph/module-graph/tree-shaking/types.js +0 -18
- package/dist/cjs/graph/module-graph/tree-shaking/variable.js +0 -69
- package/dist/cjs/graph/module-graph/types.js +0 -18
- package/dist/cjs/graph/module-graph/utils.js +0 -63
- package/dist/cjs/graph/package-graph/dependency.js +0 -64
- package/dist/cjs/graph/package-graph/graph.js +0 -170
- package/dist/cjs/graph/package-graph/index.js +0 -87
- package/dist/cjs/graph/package-graph/package.js +0 -125
- package/dist/cjs/graph/package-graph/types.js +0 -18
- package/dist/cjs/graph/package-graph/utils.js +0 -61
- package/dist/cjs/index.js +0 -60
- package/dist/esm/graph/chunk-graph/asset.mjs +0 -38
- package/dist/esm/graph/chunk-graph/chunk.mjs +0 -87
- package/dist/esm/graph/chunk-graph/entrypoint.mjs +0 -39
- package/dist/esm/graph/chunk-graph/graph.mjs +0 -75
- package/dist/esm/graph/chunk-graph/index.mjs +0 -4
- package/dist/esm/graph/index.mjs +0 -3
- package/dist/esm/graph/module-graph/dependency.mjs +0 -66
- package/dist/esm/graph/module-graph/graph.mjs +0 -285
- package/dist/esm/graph/module-graph/index.mjs +0 -6
- package/dist/esm/graph/module-graph/module.mjs +0 -284
- package/dist/esm/graph/module-graph/statement.mjs +0 -58
- package/dist/esm/graph/module-graph/tree-shaking/export.mjs +0 -68
- package/dist/esm/graph/module-graph/tree-shaking/index.mjs +0 -5
- package/dist/esm/graph/module-graph/tree-shaking/module.mjs +0 -66
- package/dist/esm/graph/module-graph/tree-shaking/sideEffect.mjs +0 -55
- package/dist/esm/graph/module-graph/tree-shaking/types.mjs +0 -0
- package/dist/esm/graph/module-graph/tree-shaking/variable.mjs +0 -35
- package/dist/esm/graph/module-graph/types.mjs +0 -0
- package/dist/esm/graph/module-graph/utils.mjs +0 -23
- package/dist/esm/graph/package-graph/dependency.mjs +0 -30
- package/dist/esm/graph/package-graph/graph.mjs +0 -123
- package/dist/esm/graph/package-graph/index.mjs +0 -4
- package/dist/esm/graph/package-graph/package.mjs +0 -91
- package/dist/esm/graph/package-graph/types.mjs +0 -0
- package/dist/esm/graph/package-graph/utils.mjs +0 -24
- package/dist/esm/index.mjs +0 -1
- package/dist/type/graph/chunk-graph/asset.d.ts.map +0 -1
- package/dist/type/graph/chunk-graph/chunk.d.ts.map +0 -1
- package/dist/type/graph/chunk-graph/entrypoint.d.ts.map +0 -1
- package/dist/type/graph/chunk-graph/graph.d.ts.map +0 -1
- package/dist/type/graph/chunk-graph/index.d.ts.map +0 -1
- package/dist/type/graph/index.d.ts.map +0 -1
- package/dist/type/graph/module-graph/dependency.d.ts.map +0 -1
- package/dist/type/graph/module-graph/graph.d.ts.map +0 -1
- package/dist/type/graph/module-graph/index.d.ts.map +0 -1
- package/dist/type/graph/module-graph/module.d.ts.map +0 -1
- package/dist/type/graph/module-graph/statement.d.ts.map +0 -1
- package/dist/type/graph/module-graph/tree-shaking/export.d.ts.map +0 -1
- package/dist/type/graph/module-graph/tree-shaking/index.d.ts.map +0 -1
- package/dist/type/graph/module-graph/tree-shaking/module.d.ts.map +0 -1
- package/dist/type/graph/module-graph/tree-shaking/sideEffect.d.ts.map +0 -1
- package/dist/type/graph/module-graph/tree-shaking/types.d.ts.map +0 -1
- package/dist/type/graph/module-graph/tree-shaking/variable.d.ts.map +0 -1
- package/dist/type/graph/module-graph/types.d.ts.map +0 -1
- package/dist/type/graph/module-graph/utils.d.ts.map +0 -1
- package/dist/type/graph/package-graph/dependency.d.ts.map +0 -1
- package/dist/type/graph/package-graph/graph.d.ts.map +0 -1
- package/dist/type/graph/package-graph/index.d.ts.map +0 -1
- package/dist/type/graph/package-graph/package.d.ts.map +0 -1
- package/dist/type/graph/package-graph/types.d.ts.map +0 -1
- package/dist/type/graph/package-graph/utils.d.ts.map +0 -1
- package/dist/type/index.d.ts +0 -2
- package/dist/type/index.d.ts.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
import { ParseBundle } from '../../types/transform';
|
|
3
|
+
export type ParsedModuleSizeData = {
|
|
4
|
+
[x: string]: {
|
|
5
|
+
size: number;
|
|
6
|
+
sizeConvert: string;
|
|
7
|
+
content: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The following code is modified based on
|
|
12
|
+
* https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/8a3d3f0f40010f2b41ccd28519eda5a44e13da3e/src/analyzer.js#L20
|
|
13
|
+
*
|
|
14
|
+
* MIT Licensed
|
|
15
|
+
* Author th0r
|
|
16
|
+
* Copyright JS Foundation and other contributors.
|
|
17
|
+
* https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/44bd8d0f9aa3b098e271af220096ea70cc44bc9e/LICENSE
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAssetsModulesData(moduleGraph: SDK.ModuleGraphInstance, chunkGraph: SDK.ChunkGraphInstance, bundleDir: string, opts: {
|
|
20
|
+
parseBundle?: ParseBundle;
|
|
21
|
+
}, sourceMapSets?: Map<string, string>): Promise<void>;
|
|
22
|
+
export declare function transformAssetsModulesData(parsedModulesData: ParsedModuleSizeData, moduleGraph: SDK.ModuleGraphInstance): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin, SDK } from '@rsdoctor/types';
|
|
2
|
+
/**
|
|
3
|
+
* Reverse decode the location (loc) information.
|
|
4
|
+
* // TODO:
|
|
5
|
+
* @link https://github.com/webpack/webpack/blob/main/lib/formatLocation.js#L30-L66
|
|
6
|
+
*/
|
|
7
|
+
export declare function getPositionByStatsLocation(loc: string): SDK.SourceRange | undefined;
|
|
8
|
+
export declare function isWebpack5orRspack(compilation: Plugin.BaseCompilation): Boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SDK, Plugin } from '@rsdoctor/types';
|
|
2
|
+
import { ModuleGraph } from '../../graph';
|
|
3
|
+
export declare function getModulesFromArray(modules: Plugin.StatsModule[], collectedModules: Plugin.StatsModule[]): void;
|
|
4
|
+
/**
|
|
5
|
+
* this function can run in browser & node.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getModuleGraphByStats({ modules, chunks }: Plugin.StatsCompilation, root: string, chunkGraph: SDK.ChunkGraphInstance): ModuleGraph;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SDK } from '@rsdoctor/types';
|
|
2
|
+
interface DependencyData {
|
|
3
|
+
type?: string;
|
|
4
|
+
}
|
|
5
|
+
/** Determine whether it is the import statement itself */
|
|
6
|
+
export declare function isImportDependency({ type }: DependencyData): boolean;
|
|
7
|
+
export declare function getImportKind(dep: DependencyData): SDK.DependencyKind;
|
|
8
|
+
/**
|
|
9
|
+
* Remove the css module without connection
|
|
10
|
+
* - This will happen when the user uses the mini-css plug-in.
|
|
11
|
+
*/
|
|
12
|
+
export declare function removeNoImportStyle(graph: SDK.ModuleGraphInstance): void;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './transStats';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Plugin, SDK } from '@rsdoctor/types';
|
|
2
|
+
/**
|
|
3
|
+
* @description Convert stats to chunkGraph and moduleGraph, online tools for rsdoctor's website.
|
|
4
|
+
* @param json
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function transStats(json: Plugin.StatsCompilation): Promise<{
|
|
8
|
+
chunkGraph: SDK.ChunkGraphInstance;
|
|
9
|
+
moduleGraph: import("../..").ModuleGraph;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Compilation, Dependency, ExternalModule, Module, ModuleGraph, NormalModule } from 'webpack';
|
|
2
|
+
import { SDK, Plugin } from '@rsdoctor/types';
|
|
3
|
+
export declare function isNormalModule(mod: Module): mod is NormalModule;
|
|
4
|
+
export declare function getWebpackModuleId(mod: Module): string;
|
|
5
|
+
export declare function getWebpackModulePath(mod: NormalModule): string;
|
|
6
|
+
export declare function getWebpackDependencyRequest(dep: Dependency, module?: NormalModule): string;
|
|
7
|
+
export declare function getResolveRequest(dep: Dependency, graph: ModuleGraph): string;
|
|
8
|
+
export declare function isExternalModule(mod: Module): mod is ExternalModule;
|
|
9
|
+
export declare function getModuleSource(mod: NormalModule): string;
|
|
10
|
+
export declare function getEntryModule(entryMap: Map<string, Plugin.EntryPoint>): NormalModule[];
|
|
11
|
+
export declare function getDependencyPosition(dep: Dependency, module: SDK.ModuleInstance, getSource?: boolean): SDK.StatementInstance | undefined;
|
|
12
|
+
export declare function getExportDependency(info: Plugin.ExportInfo, module: NormalModule): Dependency | undefined;
|
|
13
|
+
export declare function getSdkDependencyByWebpackDependency(dep: Dependency, module: NormalModule, graph: SDK.ModuleGraphInstance): SDK.DependencyInstance | undefined;
|
|
14
|
+
export declare function getExportStatement(info: Plugin.ExportInfo, normalModule: NormalModule, graph: SDK.ModuleGraphInstance): SDK.StatementInstance | undefined;
|
|
15
|
+
export declare function getLastExportInfo(info: Plugin.ExportInfo, webpackGraph: ModuleGraph): Plugin.ExportInfo | undefined;
|
|
16
|
+
export declare function getAllModules(compilation: Compilation): NormalModule[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './transform';
|
package/package.json
CHANGED
|
@@ -1,34 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/graph",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4-beta.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
7
7
|
"directory": "packages/graph"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"main": "dist/
|
|
11
|
-
"module": "dist/
|
|
12
|
-
"types": "dist/
|
|
10
|
+
"main": "dist/index.cjs",
|
|
11
|
+
"module": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"default": "./dist/index.cjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
16
24
|
"dependencies": {
|
|
17
25
|
"lodash.unionby": "^4.8.0",
|
|
18
|
-
"
|
|
26
|
+
"path-browserify": "1.0.1",
|
|
19
27
|
"source-map": "^0.7.4",
|
|
20
|
-
"@rsdoctor/types": "1.2.
|
|
21
|
-
"@rsdoctor/utils": "1.2.
|
|
28
|
+
"@rsdoctor/types": "1.2.4-beta.0",
|
|
29
|
+
"@rsdoctor/utils": "1.2.4-beta.0"
|
|
22
30
|
},
|
|
23
31
|
"devDependencies": {
|
|
24
|
-
"@rslib/core": "^0.11.0",
|
|
25
32
|
"@types/body-parser": "1.19.6",
|
|
26
33
|
"@types/estree": "1.0.5",
|
|
27
34
|
"@types/lodash.unionby": "^4.8.9",
|
|
35
|
+
"@types/path-browserify": "1.0.3",
|
|
28
36
|
"@types/node": "^22.8.1",
|
|
29
37
|
"fs-extra": "^11.1.1",
|
|
30
38
|
"tslib": "2.8.1",
|
|
31
|
-
"typescript": "^5.
|
|
39
|
+
"typescript": "^5.9.2",
|
|
40
|
+
"webpack": "^5.97.1"
|
|
32
41
|
},
|
|
33
42
|
"publishConfig": {
|
|
34
43
|
"access": "public",
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
Asset: ()=>Asset
|
|
28
|
-
});
|
|
29
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
30
|
-
const external_node_zlib_namespaceObject = require("node:zlib");
|
|
31
|
-
let asset_id = 1;
|
|
32
|
-
class Asset {
|
|
33
|
-
static init() {
|
|
34
|
-
asset_id = 1;
|
|
35
|
-
}
|
|
36
|
-
toData(types) {
|
|
37
|
-
var _this_chunks;
|
|
38
|
-
return {
|
|
39
|
-
id: this.id,
|
|
40
|
-
path: this.path,
|
|
41
|
-
size: this.size,
|
|
42
|
-
gzipSize: this.gzipSize,
|
|
43
|
-
chunks: null == (_this_chunks = this.chunks) ? void 0 : _this_chunks.map((ck)=>ck.id),
|
|
44
|
-
content: types === types_namespaceObject.SDK.ToDataType.NoSourceAndAssets || types === types_namespaceObject.SDK.ToDataType.NoCode ? '' : this.content
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
setChunks(chunks) {
|
|
48
|
-
this.chunks = chunks;
|
|
49
|
-
}
|
|
50
|
-
setId(id) {
|
|
51
|
-
this.id = id;
|
|
52
|
-
}
|
|
53
|
-
setGzipSize(content) {
|
|
54
|
-
this.gzipSize = (0, external_node_zlib_namespaceObject.gzipSync)(content, {
|
|
55
|
-
level: 9
|
|
56
|
-
}).length;
|
|
57
|
-
}
|
|
58
|
-
constructor(path, size, chunks, content){
|
|
59
|
-
this.id = asset_id++;
|
|
60
|
-
this.path = path;
|
|
61
|
-
this.size = size;
|
|
62
|
-
this.chunks = chunks;
|
|
63
|
-
this.content = content;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.Asset = __webpack_exports__.Asset;
|
|
67
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
68
|
-
"Asset"
|
|
69
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
70
|
-
Object.defineProperty(exports, '__esModule', {
|
|
71
|
-
value: true
|
|
72
|
-
});
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
Chunk: ()=>Chunk
|
|
28
|
-
});
|
|
29
|
-
class Chunk {
|
|
30
|
-
isEntry() {
|
|
31
|
-
return this.entry;
|
|
32
|
-
}
|
|
33
|
-
isChunkEntryModule(module) {
|
|
34
|
-
return module.isEntry || module.getImported().every((item)=>!this.hasModule(item));
|
|
35
|
-
}
|
|
36
|
-
hasModule(module) {
|
|
37
|
-
return this._modules.includes(module);
|
|
38
|
-
}
|
|
39
|
-
addModule(module) {
|
|
40
|
-
if (!this.hasModule(module)) {
|
|
41
|
-
this._modules.push(module);
|
|
42
|
-
module.addChunk(this);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
addAsset(asset) {
|
|
46
|
-
this._assets.push(asset);
|
|
47
|
-
}
|
|
48
|
-
addModules(modules) {
|
|
49
|
-
modules.forEach((module)=>{
|
|
50
|
-
if (!this.hasModule(module)) {
|
|
51
|
-
this._modules.push(module);
|
|
52
|
-
module.addChunk(this);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
addDependency(dep) {
|
|
57
|
-
if (!this._dependencies.includes(dep)) this._dependencies.push(dep);
|
|
58
|
-
}
|
|
59
|
-
addImported(imported) {
|
|
60
|
-
if (!this._imported.includes(imported)) this._imported.push(imported);
|
|
61
|
-
}
|
|
62
|
-
getAssets() {
|
|
63
|
-
return this._assets.slice();
|
|
64
|
-
}
|
|
65
|
-
getModules() {
|
|
66
|
-
return this._modules.slice();
|
|
67
|
-
}
|
|
68
|
-
getDependencies() {
|
|
69
|
-
return this._dependencies.slice();
|
|
70
|
-
}
|
|
71
|
-
getImported() {
|
|
72
|
-
return this._imported.slice();
|
|
73
|
-
}
|
|
74
|
-
setParsedSize(parsedSize) {
|
|
75
|
-
this._parsedSize = parsedSize;
|
|
76
|
-
}
|
|
77
|
-
toData() {
|
|
78
|
-
return {
|
|
79
|
-
id: this.id,
|
|
80
|
-
name: this.name,
|
|
81
|
-
initial: this.initial,
|
|
82
|
-
size: this.size,
|
|
83
|
-
parsedSize: this._parsedSize || 0,
|
|
84
|
-
entry: this.isEntry(),
|
|
85
|
-
assets: this._assets.map(({ path })=>path),
|
|
86
|
-
modules: this._modules.map(({ id })=>id),
|
|
87
|
-
dependencies: this._dependencies.map(({ id })=>id),
|
|
88
|
-
imported: this._imported.map(({ id })=>id)
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
setDependencies(dependencies) {
|
|
92
|
-
this._dependencies = dependencies;
|
|
93
|
-
}
|
|
94
|
-
setImported(imported) {
|
|
95
|
-
this._imported = imported;
|
|
96
|
-
}
|
|
97
|
-
setModules(modules) {
|
|
98
|
-
this._modules = modules;
|
|
99
|
-
}
|
|
100
|
-
setAssets(assets) {
|
|
101
|
-
this._assets = assets;
|
|
102
|
-
}
|
|
103
|
-
constructor(id, name, size, initial, entry){
|
|
104
|
-
this._assets = [];
|
|
105
|
-
this._modules = [];
|
|
106
|
-
this._dependencies = [];
|
|
107
|
-
this._imported = [];
|
|
108
|
-
this.id = id;
|
|
109
|
-
this.name = name;
|
|
110
|
-
this.size = size;
|
|
111
|
-
this.initial = initial;
|
|
112
|
-
this.entry = entry;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
exports.Chunk = __webpack_exports__.Chunk;
|
|
116
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
117
|
-
"Chunk"
|
|
118
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
119
|
-
Object.defineProperty(exports, '__esModule', {
|
|
120
|
-
value: true
|
|
121
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
EntryPoint: ()=>EntryPoint
|
|
28
|
-
});
|
|
29
|
-
let id = 1;
|
|
30
|
-
class EntryPoint {
|
|
31
|
-
static init() {
|
|
32
|
-
id = 1;
|
|
33
|
-
}
|
|
34
|
-
addChunk(chunk) {
|
|
35
|
-
if (this._chunks.includes(chunk)) return;
|
|
36
|
-
this._chunks.push(chunk);
|
|
37
|
-
}
|
|
38
|
-
addAsset(asset) {
|
|
39
|
-
if (this._assets.includes(asset)) return;
|
|
40
|
-
this._assets.push(asset);
|
|
41
|
-
}
|
|
42
|
-
toData() {
|
|
43
|
-
return {
|
|
44
|
-
id: this.id,
|
|
45
|
-
name: this.name,
|
|
46
|
-
chunks: this._chunks.map((e)=>e.id),
|
|
47
|
-
assets: this._assets.map((e)=>e.path),
|
|
48
|
-
size: this._assets.length ? this._assets.reduce((t, e)=>t + e.size, 0) : 0
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
setChunks(chunks) {
|
|
52
|
-
this._chunks = chunks;
|
|
53
|
-
}
|
|
54
|
-
setAssets(assets) {
|
|
55
|
-
this._assets = assets;
|
|
56
|
-
}
|
|
57
|
-
setId(id) {
|
|
58
|
-
this.id = id;
|
|
59
|
-
}
|
|
60
|
-
constructor(name){
|
|
61
|
-
this.name = name;
|
|
62
|
-
this._chunks = [];
|
|
63
|
-
this._assets = [];
|
|
64
|
-
this.id = id++;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.EntryPoint = __webpack_exports__.EntryPoint;
|
|
68
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
69
|
-
"EntryPoint"
|
|
70
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
71
|
-
Object.defineProperty(exports, '__esModule', {
|
|
72
|
-
value: true
|
|
73
|
-
});
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
ChunkGraph: ()=>ChunkGraph
|
|
28
|
-
});
|
|
29
|
-
class ChunkGraph {
|
|
30
|
-
getAssets() {
|
|
31
|
-
return Array.from(this._assetMap.values());
|
|
32
|
-
}
|
|
33
|
-
getChunks() {
|
|
34
|
-
return Array.from(this._chunkMap.values());
|
|
35
|
-
}
|
|
36
|
-
addAsset(...assets) {
|
|
37
|
-
assets.forEach((asset)=>{
|
|
38
|
-
this._assetMap.set(asset.id, asset);
|
|
39
|
-
this._assetPathMap.set(asset.path, asset);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
addChunk(...chunks) {
|
|
43
|
-
chunks.forEach((chunk)=>{
|
|
44
|
-
this._chunkMap.set(chunk.id, chunk);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
getChunkById(id) {
|
|
48
|
-
return this._chunkMap.get(id);
|
|
49
|
-
}
|
|
50
|
-
getAssetByPath(path) {
|
|
51
|
-
return this._assetPathMap.get(path);
|
|
52
|
-
}
|
|
53
|
-
getAssetById(id) {
|
|
54
|
-
return this._assetMap.get(id);
|
|
55
|
-
}
|
|
56
|
-
getEntryPoints() {
|
|
57
|
-
return Array.from(this._entrypointMap.values());
|
|
58
|
-
}
|
|
59
|
-
getEntryPointById(id) {
|
|
60
|
-
return this._entrypointMap.get(id);
|
|
61
|
-
}
|
|
62
|
-
addEntryPoint(...entrypoints) {
|
|
63
|
-
entrypoints.forEach((entrypoint)=>{
|
|
64
|
-
this._entrypointMap.set(entrypoint.id, entrypoint);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
toData(type) {
|
|
68
|
-
return {
|
|
69
|
-
assets: Array.from(this._assetMap.values()).map((item)=>item.toData(type)),
|
|
70
|
-
chunks: Array.from(this._chunkMap.values()).map((item)=>item.toData()),
|
|
71
|
-
entrypoints: Array.from(this._entrypointMap.values()).map((item)=>item.toData())
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
setChunks(chunks) {
|
|
75
|
-
this._chunkMap = new Map(chunks.map((item)=>[
|
|
76
|
-
item.id,
|
|
77
|
-
item
|
|
78
|
-
]));
|
|
79
|
-
}
|
|
80
|
-
setEntrypoints(entrypoints) {
|
|
81
|
-
this._entrypointMap = new Map(entrypoints.map((item)=>[
|
|
82
|
-
item.id,
|
|
83
|
-
item
|
|
84
|
-
]));
|
|
85
|
-
}
|
|
86
|
-
setAssets(assets) {
|
|
87
|
-
this._assetMap = new Map(assets.map((item)=>[
|
|
88
|
-
item.id,
|
|
89
|
-
item
|
|
90
|
-
]));
|
|
91
|
-
this._assetPathMap = new Map(assets.map((item)=>[
|
|
92
|
-
item.path,
|
|
93
|
-
item
|
|
94
|
-
]));
|
|
95
|
-
}
|
|
96
|
-
constructor(){
|
|
97
|
-
this._assetMap = new Map();
|
|
98
|
-
this._assetPathMap = new Map();
|
|
99
|
-
this._chunkMap = new Map();
|
|
100
|
-
this._entrypointMap = new Map();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
exports.ChunkGraph = __webpack_exports__.ChunkGraph;
|
|
104
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
105
|
-
"ChunkGraph"
|
|
106
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
107
|
-
Object.defineProperty(exports, '__esModule', {
|
|
108
|
-
value: true
|
|
109
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_modules__ = {
|
|
3
|
-
"./asset": function(module) {
|
|
4
|
-
module.exports = require("./asset.js");
|
|
5
|
-
},
|
|
6
|
-
"./chunk": function(module) {
|
|
7
|
-
module.exports = require("./chunk.js");
|
|
8
|
-
},
|
|
9
|
-
"./entrypoint": function(module) {
|
|
10
|
-
module.exports = require("./entrypoint.js");
|
|
11
|
-
},
|
|
12
|
-
"./graph?d2f9": function(module) {
|
|
13
|
-
module.exports = require("./graph.js");
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var __webpack_module_cache__ = {};
|
|
17
|
-
function __webpack_require__(moduleId) {
|
|
18
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
19
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
20
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
21
|
-
exports: {}
|
|
22
|
-
};
|
|
23
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
24
|
-
return module.exports;
|
|
25
|
-
}
|
|
26
|
-
(()=>{
|
|
27
|
-
__webpack_require__.n = (module)=>{
|
|
28
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
29
|
-
__webpack_require__.d(getter, {
|
|
30
|
-
a: getter
|
|
31
|
-
});
|
|
32
|
-
return getter;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
(()=>{
|
|
36
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
37
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: definition[key]
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
})();
|
|
43
|
-
(()=>{
|
|
44
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
45
|
-
})();
|
|
46
|
-
(()=>{
|
|
47
|
-
__webpack_require__.r = (exports1)=>{
|
|
48
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
49
|
-
value: 'Module'
|
|
50
|
-
});
|
|
51
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
52
|
-
value: true
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
})();
|
|
56
|
-
var __webpack_exports__ = {};
|
|
57
|
-
(()=>{
|
|
58
|
-
__webpack_require__.r(__webpack_exports__);
|
|
59
|
-
var _chunk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./chunk");
|
|
60
|
-
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
61
|
-
for(var __WEBPACK_IMPORT_KEY__ in _chunk__WEBPACK_IMPORTED_MODULE_0__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
62
|
-
return _chunk__WEBPACK_IMPORTED_MODULE_0__[key];
|
|
63
|
-
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
64
|
-
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
65
|
-
var _graph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./graph?d2f9");
|
|
66
|
-
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
67
|
-
for(var __WEBPACK_IMPORT_KEY__ in _graph__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
68
|
-
return _graph__WEBPACK_IMPORTED_MODULE_1__[key];
|
|
69
|
-
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
70
|
-
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
71
|
-
var _asset__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./asset");
|
|
72
|
-
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
73
|
-
for(var __WEBPACK_IMPORT_KEY__ in _asset__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
74
|
-
return _asset__WEBPACK_IMPORTED_MODULE_2__[key];
|
|
75
|
-
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
76
|
-
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
77
|
-
var _entrypoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./entrypoint");
|
|
78
|
-
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
79
|
-
for(var __WEBPACK_IMPORT_KEY__ in _entrypoint__WEBPACK_IMPORTED_MODULE_3__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
80
|
-
return _entrypoint__WEBPACK_IMPORTED_MODULE_3__[key];
|
|
81
|
-
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
82
|
-
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
83
|
-
})();
|
|
84
|
-
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
85
|
-
Object.defineProperty(exports, '__esModule', {
|
|
86
|
-
value: true
|
|
87
|
-
});
|