Created
December 10, 2017 20:46
-
-
Save jprivillaso/deb8f6f28f487adb076447008b7406c3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const generateWebpackStats = (info, webpackProcessName) => { | |
const fs = require('fs'); | |
const dir = path.resolve(__dirname, '../../stats'); | |
if (!fs.existsSync(dir)) { | |
fs.mkdirSync(dir); | |
} | |
const fileName = `../../stats/${webpackProcessName}-stats.json`; | |
fs.writeFile(path.resolve(__dirname, fileName), JSON.stringify(info), (err) => { | |
if(err) { | |
console.log(err); | |
} else { | |
console.log(`${webpackProcessName}-stats.json were saved successfully!`); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment