Using Gulp and Browserify to bundle multiple files

I am relatively new to front-end development, and have a question about using Gulp and Browserify together.

Here is a description of my setup: I have a project folder that contains everything related to my project (css, html, js, etc.) In my javascript directory, I have a sub-directory named "modules" which contains, say, three sub-directories of its own: A, B, and C. Each of these three sub-directories contains any number of js files. Take sub-directory A, for example; it may contain js files 1.js, 2.js, and 3.js. Each of these may import (using the 'require' statement that Browserify recognizes) node dependencies.

I want Browserify/Gulp to give me a bundled js file for each of the sub-directories A, B, and C which contain the respective javascript files bundled along with their dependencies. Take again the example js files above in the directory A: the build process should produce an output A.js that contains 1.js, 2.js, and 3.js, as well as the modules imported via 'require'. Similar outputs should exist for B and C.

Thanks in advance for any pointers whatsoever!


为每个文件夹配方生成文件可能会指导您如何执行每个文件夹的吞吐流量。

链接地址: http://www.djcxy.com/p/32904.html

上一篇: 级别的捆绑是否被非SPA使用处理?

下一篇: 使用Gulp和Browserify捆绑多个文件