Skip to content

Commit ce12eb1

Browse files
committed
support single files
1 parent 285df17 commit ce12eb1

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

bin/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
const parseArgs = require('minimist');
55
const lassoAnalyzer = require('../src/index');
6-
const bundleMe = require('bundle-me');
6+
const { createBundle } = require('bundle-me');
77
const argv = parseArgs(process.argv.slice(2));
88
const borderX = `${Array(30).join('-')}\n`;
99
const input = argv._ || [];
1010

1111
if (input.length > 0) {
1212
input.map((fileName) => {
13-
bundleMe({ path: fileName, outputPath: 'lasso-analyze.js' }).createBundle;
13+
createBundle({ path: fileName, outputPath: 'lasso-analyze.js' }).createBundle;
1414
lassoAnalyzer('lasso-analyze.js');
1515
});
1616
const startLog = `${borderX}` + `lasso-analyze.html is created \n` +

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"name": "lasso-analyzer",
3-
"version": "1.1.10",
3+
"version": "1.2.0",
44
"description": "A tool to analyze the bundle created by Lasso",
5-
"main": "src/lasso-analyzer-plugin.js",
5+
"main": "src/index.js",
66
"bin": {
77
"lasso-analyzer": "bin/index.js"
88
},
99
"scripts": {
1010
"clean": "rm -rf *.html *.js lasso-stats.json",
1111
"test": "npm run jshint",
12-
"jshint": "jshint"
12+
"jshint": "jshint",
13+
"analyze": "lasso-analyzer static"
1314
},
1415
"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"
1718
},
1819
"repository": {
1920
"type": "git",

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const Tree = require('./tree');
66
function bundleAnalyzer(fileName, bundleName) {
77
// load lasso-unpack and create lasso-stats.json
88
// unpack the bundle using lasso-unpack.
9+
let filename = "demo.js";
910
lassoUnpack(fileName);
1011
const readFile = fs.readFileSync(path.resolve("lasso-stats.json"), 'utf8');
1112
const readJSON = JSON.parse(readFile);
@@ -69,4 +70,5 @@ function replaceTreeDate(lassoHTML, treeData) {
6970
return lassoHTML.replace('@@WEBTREEMAPDATA', treeToString);
7071
}
7172

73+
bundleAnalyzer('demo.js', '');
7274
module.exports = bundleAnalyzer;

0 commit comments

Comments
 (0)