app.js是Browserify的入口。
众所周知,以下方法有效。
in app.js
require('./a.js'); // app.js requires only child files, does nothing else
in a.js
var $ = require('jquery'); // each child file requires vendor plugins
$(document).....
我见过人们在做以下事情
in app.js
require('jquery'); // app.js requires all vendor plugins used by all child files
require('./a.js'); // requires child files
in a.js
var $ = require('jquery'); // each child file requires vendor plugins
$(document).....
问题:为什么要在app.js中要求所有供应商插件?是有必要还是推荐?