Skip to content

Instantly share code, notes, and snippets.

@AllenFang
Created July 16, 2018 07:44
Show Gist options
  • Save AllenFang/93a538ccf2605dda0a140089450e26a2 to your computer and use it in GitHub Desktop.
Save AllenFang/93a538ccf2605dda0a140089450e26a2 to your computer and use it in GitHub Desktop.
import gulpWebpack from 'webpack-stream';
import config from './config/webpack.prod.config';
function webpack() {
return gulp.src(Object.values(config.entry))
.pipe(gulpWebpack({ config }, null, (err, stats) => {
stats.compilation.chunks.forEach(({ files: assets, name }) => {
// name is chunk name
// assets is chunk file name
// persist them here!
});
}))
.pipe(gulp.dest(config.output.path));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment