File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 3
3
4
4
const parseArgs = require ( 'minimist' ) ;
5
5
const lassoAnalyzer = require ( '../src/index' ) ;
6
- const bundleMe = require ( 'bundle-me' ) ;
6
+ const { createBundle } = require ( 'bundle-me' ) ;
7
7
const argv = parseArgs ( process . argv . slice ( 2 ) ) ;
8
8
const borderX = `${ Array ( 30 ) . join ( '-' ) } \n` ;
9
9
const input = argv . _ || [ ] ;
10
10
11
11
if ( input . length > 0 ) {
12
12
input . map ( ( fileName ) => {
13
- bundleMe ( { path : fileName , outputPath : 'lasso-analyze.js' } ) . createBundle ;
13
+ createBundle ( { path : fileName , outputPath : 'lasso-analyze.js' } ) . createBundle ;
14
14
lassoAnalyzer ( 'lasso-analyze.js' ) ;
15
15
} ) ;
16
16
const startLog = `${ borderX } ` + `lasso-analyze.html is created \n` +
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " lasso-analyzer" ,
3
- "version" : " 1.1.10 " ,
3
+ "version" : " 1.2.0 " ,
4
4
"description" : " A tool to analyze the bundle created by Lasso" ,
5
- "main" : " src/lasso-analyzer-plugin .js" ,
5
+ "main" : " src/index .js" ,
6
6
"bin" : {
7
7
"lasso-analyzer" : " bin/index.js"
8
8
},
9
9
"scripts" : {
10
10
"clean" : " rm -rf *.html *.js lasso-stats.json" ,
11
11
"test" : " npm run jshint" ,
12
- "jshint" : " jshint"
12
+ "jshint" : " jshint" ,
13
+ "analyze" : " lasso-analyzer static"
13
14
},
14
15
"dependencies" : {
15
- "lasso-unpack " : " 1.0 .2" ,
16
- "bundle-me " : " ~ 1.0.0 "
16
+ "bundle-me " : " ^1.1 .2" ,
17
+ "lasso-unpack " : " 1.0.2 "
17
18
},
18
19
"repository" : {
19
20
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const Tree = require('./tree');
6
6
function bundleAnalyzer ( fileName , bundleName ) {
7
7
// load lasso-unpack and create lasso-stats.json
8
8
// unpack the bundle using lasso-unpack.
9
+ let filename = "demo.js" ;
9
10
lassoUnpack ( fileName ) ;
10
11
const readFile = fs . readFileSync ( path . resolve ( "lasso-stats.json" ) , 'utf8' ) ;
11
12
const readJSON = JSON . parse ( readFile ) ;
@@ -69,4 +70,5 @@ function replaceTreeDate(lassoHTML, treeData) {
69
70
return lassoHTML . replace ( '@@WEBTREEMAPDATA' , treeToString ) ;
70
71
}
71
72
73
+ bundleAnalyzer ( 'demo.js' , '' ) ;
72
74
module . exports = bundleAnalyzer ;
You can’t perform that action at this time.
0 commit comments