feat(cli-service): add stdin flag to build (#5376)

This commit is contained in:
Adrian B. Danieli
2020-05-08 01:28:16 -07:00
committed by GitHub
parent 5e93d70e65
commit c64afc3c2a
@@ -37,7 +37,8 @@ module.exports = (api, options) => {
'--report': `generate report.html to help analyze bundle content`,
'--report-json': 'generate report.json to help analyze bundle content',
'--skip-plugins': `comma-separated list of plugin names to skip for this run`,
'--watch': `watch for changes`
'--watch': `watch for changes`,
'--stdin': `close when stdin ends`
}
}, async (args, rawArgs) => {
for (const key in defaults) {
@@ -155,6 +156,13 @@ async function build (args, api, options) {
})
}
if (args.stdin) {
process.stdin.on('end', () => {
process.exit(0)
})
process.stdin.resume()
}
// Expose advanced stats
if (args.dashboard) {
const DashboardPlugin = require('../../webpack/DashboardPlugin')