Skip to content

Commit f412e82

Browse files
author
Cookie Feng
authored
Update bundler.js
1 parent 7cdc508 commit f412e82

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bundler.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ function createAsset(filename) {
5151
function createGraph(entry) {
5252
const mainAsset = createAsset(entry);
5353

54-
//定义一个保存依赖项的数组
54+
//既然要广度遍历肯定要有一个队列,第一个元素肯定是 从 "./example/entry.js" 返回的信息
5555
const queue = [mainAsset];
56-
56+
57+
5758
for (const asset of queue) {
5859
const dirname = path.dirname(asset.filename);
5960

60-
//声明一个变量来保存子依赖项的数据
61+
//新增一个属性来保存子依赖项的数据
6162
//保存类似 这样的数据结构 ---> {"./message.js" : 1}
6263
asset.mapping = {};
6364

0 commit comments

Comments
 (0)