const fs = require('fs-extra'); const path = require('path'); const yargs = require('yargs')(process.argv.slice(2)); const argv = yargs .usage('Usage: $0 -d ') .help('help') .alias('version', 'v') .option('help', { alias: 'h' }) .option('dist', { alias: 'd', type: 'string', requiresArg: true, describe: 'The directory where dependencies would be copies to.', }) .option('dryrun', { type: 'boolean', describe: 'Find the dependencies and log to the screen only.', }) .option('verbose', { alias: 'V', type: 'boolean', describe: 'Enable verbose log.', }) .argv; const pkgfile = require('./package'); function getDependencies(filePath) { let allDependencies = []; let cssDependencies = []; let jsDependencies = []; let fontDependencies = []; let fileDir = path.dirname(filePath); let fileContent = fs.readFileSync(filePath, 'utf8'); let cssPattern = //g; let jsPattern = /