1 | const walk = require('walk');
|
2 |
|
3 | const config = require('./config');
|
4 |
|
5 |
|
6 | const walker = walk.walk(config.root);
|
7 | walker.on('file', function (root, fileStats, next) {
|
8 | const ext = path.extname(fileStats.name);
|
9 | const basename = fileStats.name;
|
10 | if (ext === '.js') {
|
11 | if (basename.indexOf('vendor') === 0) {
|
12 | next();
|
13 | } else {
|
14 | data.js.push(basename);
|
15 | }
|
16 | } else if (ext === '.css') {
|
17 | data.css.push(basename);
|
18 | }
|
19 |
|
20 | next();
|
21 | });
|
22 |
|
23 |
|
24 | walker.on('end', () => {
|
25 |
|
26 |
|
27 |
|
28 | }); |
\ | No newline at end of file |