You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the default exported function is identical to init, and returns the same functions as export {init, formatted, analyze}. So, you can `require('rollup-analyzer')` or `require('rollup-analyzer')({limit: 5})` and use the same functions.
64
-
65
-
### rollupAnalyzer.init(options)
66
-
set options to use in analysis (this step is optional)
67
-
-**options***(Object)*
64
+
Module exports `analyze`, `formatted`, and `plugin` functions
65
+
66
+
### formatted(bundle, options)
67
+
- arguments
68
+
-**bundle***(Rollup Bundle)*
69
+
-**options***(Object - see below for available options)*
70
+
- returns
71
+
-**analysisText***(String - well formatted for console printing)*
72
+
73
+
### analyze(bundle, options)
74
+
- arguments
75
+
-**bundle***(Rollup Bundle)*
76
+
-**options***(Object - see below for available options)*
77
+
- returns
78
+
-**analysis***(Object)*
79
+
-**id***(String)* - path of module / rollup module id
80
+
-**size***(Number)* - size of module in bytes
81
+
-**dependents***(Array)* - list of dependent module ids / paths
82
+
-**percent***(Number)* - percentage of module size relative to entire bundle
83
+
84
+
#### options `Object`
68
85
-**limit** - *optional*
69
86
- type: Number
70
87
- default: `null`
@@ -78,20 +95,6 @@ set options to use in analysis (this step is optional)
78
95
- default: `process.cwd()`
79
96
- description: Application directory, used to display file paths relatively
80
97
81
-
### rollupAnalyzer.formatted(bundle)
82
-
returns Promise which resolves with well formatted analysis string (for CLI printing)
83
-
-**bundle***(Rollup Bundle)* - *required*
84
-
85
-
### rollupAnalyzer.analyze(bundle)
86
-
returns Promise which resolves with array of objects describing each imported file
87
-
-**bundle***(Rollup Bundle)* - *required*
88
-
89
-
returned array's child analysis objects have the following properties
90
-
-**id***(String)* - path of module / rollup module id
91
-
-**size***(Number)* - size of module in bytes
92
-
-**dependents***(Array)* - list of dependent module ids / paths
93
-
-**percent***(Number)* - percentage of module size relative to entire bundle
0 commit comments