Created
March 25, 2015 11:05
-
-
Save Willmo36/626ca4768bd89b61ce23 to your computer and use it in GitHub Desktop.
Delete old chunk files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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