Skip to content

Commit 2af8b41

Browse files
committed
Bumping version, commenting out webpack stats generation until we weed out subtle issues with it.
1 parent 4c25de3 commit 2af8b41

File tree

2 files changed

+36
-27
lines changed

2 files changed

+36
-27
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gulp-core-build-webpack",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",

src/WebpackTask.ts

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -63,41 +63,50 @@ export class WebpackTask extends GulpTask<IWebpackConfig> {
6363
completeEntries++;
6464

6565
let duration = (new Date().getTime() - startTime);
66+
let statsResultChildren = statsResult.children ? statsResult.children : [ statsResult ];
6667

67-
statsResult.chunks.forEach(chunk => chunk.files.forEach(file => (
68-
this.log(`Bundled: '${gutil.colors.cyan(path.basename(file))}', ` +
69-
`size: ${gutil.colors.magenta(chunk.size)} bytes, ` +
70-
`took ${gutil.colors.magenta(duration)} ms.`)
71-
)));
68+
statsResultChildren.forEach(child => {
69+
child.chunks.forEach(chunk => {
7270

73-
let chunk;
71+
chunk.files.forEach(file => (
72+
this.log(`Bundled: '${gutil.colors.cyan(path.basename(file))}', ` +
73+
`size: ${gutil.colors.magenta(chunk.size)} bytes, ` +
74+
`took ${gutil.colors.magenta(duration)} ms.`)
75+
)); // end file
7476

75-
for (let i = 0; i < statsResult.chunks.length; i++) {
76-
let chunkStats = {
77-
chunk: null,
78-
modules: null
79-
};
77+
/*
8078
81-
chunkStats.chunk = chunk = statsResult.chunks[i];
79+
let chunkStats = {
80+
chunk: chunk,
81+
modules: null
82+
};
83+
let statsPath = path.join(outputDir, chunk.files[0]) + '.stats.json';
8284
83-
let statsPath = path.join(outputDir, chunk.files[0]) + '.stats.json';
85+
if (child.modules) {
86+
chunkStats.modules = statsResult.modules
87+
.filter(mod => (mod.chunks && mod.chunks.indexOf(chunk.id) > -1))
88+
.map(mod => ({ name: mod.name, size: mod.size }))
89+
.sort((a, b) => (a.size < b.size ? 1 : -1));
90+
}
8491
85-
if (statsResult.modules) {
86-
chunkStats.modules = statsResult.modules
87-
.filter(mod => (mod.chunks && mod.chunks.indexOf(chunk.id) > -1))
88-
.map(mod => ({ name: mod.name, size: mod.size }))
89-
.sort((a, b) => (a.size < b.size ? 1 : -1));
90-
}
92+
let fs = require('fs');
9193
92-
let fs = require('fs');
94+
fs.writeFileSync(
95+
statsPath,
96+
JSON.stringify(chunkStats, null, 2),
97+
'utf8'
98+
);
99+
*/
93100

94-
fs.writeFileSync(
95-
statsPath,
96-
JSON.stringify(chunkStats, null, 2),
97-
'utf8'
98-
);
101+
}); // end chunk
102+
103+
}); // end child
104+
105+
if (completeEntries === this.taskConfig.configPaths.length) {
106+
completeCallback();
99107
}
100-
});
108+
109+
}); // endwebpack callback
101110
}
102111

103112
if (completeEntries === this.taskConfig.configPaths.length) {

0 commit comments

Comments
 (0)