File tree Expand file tree Collapse file tree 5 files changed +23
-10
lines changed Expand file tree Collapse file tree 5 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -23,22 +23,21 @@ require('lasso').configure({
23
23
]
24
24
});
25
25
```
26
- Creates lasso-analyze.html in your project directory.
27
-
28
-
29
- <p align =" center " >
30
- <img alt="lasso-analyzer" src="https://raw.githubusercontent.com/ajay2507/lasso-analyzer/master/example/lasso-analyze.png" width="512">
31
- </p >
32
26
33
27
## Usage as CLI ##
34
28
35
29
1 . Bundled file is created under "build/static/" folder. Run the CLI as shown below
36
30
37
31
``` bash
38
- lasso-analyzer < --bundle path--> < --outputFilename -->
32
+ lasso-analyzer < --bundle path--> --output < --output filename -->
39
33
```
40
34
Creates outputFilename.html in your project structure.
41
35
36
+ ``` bash
37
+ Options:
38
+ --output To change the generated output filename. (default - lasso-analyze.html)
39
+ ```
40
+
42
41
For Example:
43
42
44
43
a. Analyze js bundle file.
@@ -60,6 +59,12 @@ open lasso-analyze.html
60
59
```
61
60
3 . It shows you a treemap visualization as shown below.
62
61
62
+ ## Output
63
+ Creates lasso-analyze.html in your project directory.
64
+
65
+ <p align =" center " >
66
+ <img alt="lasso-analyzer" src="https://raw.githubusercontent.com/ajay2507/lasso-analyzer/master/example/lasso-analyze.png" width="512">
67
+ </p >
63
68
64
69
## Issues ##
65
70
Free feel to create bug or propose improvements.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " lasso-analyzer" ,
3
- "version" : " 1.4.0 " ,
3
+ "version" : " 1.4.1 " ,
4
4
"description" : " A tool to analyze the bundle created by Lasso" ,
5
5
"main" : " src/index.js" ,
6
6
"bin" : {
14
14
},
15
15
"dependencies" : {
16
16
"bundle-me" : " ^1.1.4" ,
17
- "lasso-unpack" : " 1.0.2"
17
+ "lasso-unpack" : " 1.0.2" ,
18
+ "opener" : " ^1.5.1"
18
19
},
19
20
"repository" : {
20
21
"type" : " git" ,
Original file line number Diff line number Diff line change 1
1
const fs = require ( 'fs' ) ;
2
2
const path = require ( 'path' ) ;
3
3
const lassoUnpack = require ( 'lasso-unpack' ) ;
4
+ const opener = require ( 'opener' ) ;
4
5
const Tree = require ( './tree' ) ;
5
6
6
7
function bundleAnalyzer ( fileName , bundleName ) {
@@ -20,6 +21,8 @@ function bundleAnalyzer(fileName, bundleName) {
20
21
const html = generateHTML ( tree ) ;
21
22
if ( ! bundleName ) bundleName = "lasso-analyze" ;
22
23
fs . writeFileSync ( getOutputHTML ( bundleName ) , html ) ;
24
+ // open the browser with generated html
25
+ opener ( getOutputHTML ( bundleName ) ) ;
23
26
// clean files
24
27
cleanFiles ( ) ;
25
28
} ;
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ module.exports = (lasso, config) => {
36
36
if ( bundlePath ) {
37
37
lassoAnalyzer ( bundlePath , bundleName ) ;
38
38
}
39
-
40
39
}
41
40
} ) ;
42
41
const endLog = `${ borderX } ` + `Created lasso-analyze.html in your project structure \n` +
Original file line number Diff line number Diff line change @@ -195,6 +195,11 @@ once@^1.3.0:
195
195
dependencies :
196
196
wrappy "1"
197
197
198
+ opener@^1.5.1 :
199
+ version "1.5.1"
200
+ resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed"
201
+ integrity sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==
202
+
198
203
path-is-absolute@^1.0.0 :
199
204
version "1.0.1"
200
205
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
You can’t perform that action at this time.
0 commit comments