Skip to content

Instantly share code, notes, and snippets.

@Willmo36
Created March 25, 2015 11:05
Show Gist options
  • Save Willmo36/626ca4768bd89b61ce23 to your computer and use it in GitHub Desktop.
Save Willmo36/626ca4768bd89b61ce23 to your computer and use it in GitHub Desktop.
Delete old chunk files
plugins: [
function () {
var distPath = "./dist";
this.plugin("done", function (stats) {
var finalFile = stats.toJson().assetsByChunkName.main;
fs.readdirSync(distPath).forEach(function (filename) {
if (filename !== finalFile) {
fs.unlinkSync(distPath + filename);
}
})
})
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment