{"size": 787, "ext": "js", "max_stars_repo_path": "tools/build.js", "max_stars_repo_name": "ShaMan123/math-input", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "tools/build.js", "max_issues_repo_name": "ShaMan123/math-input", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tools/build.js", "max_forks_repo_name": "ShaMan123/math-input", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 43.7222222222, "max_line_length": 141, "alphanum_fraction": 0.707750953}
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');

const root = path.resolve(__dirname, '..');
const folder = path.resolve(root, 'build/dist');

const __DEV__ = process.argv[2] === '--dev';

!fs.existsSync(folder) && fs.mkdirSync(folder);
fs.copyFileSync(path.resolve(root, 'node_modules/jquery/dist/jquery.min.js'), path.resolve(folder, 'jquery.min.js'));
fs.copyFileSync(path.resolve(root, 'node_modules/babel-polyfill/browser.js'), path.resolve(folder, 'babel-polyfill-browser.js'));

execSync('npm run css', { cwd: root, stdio: 'inherit' });
execSync(__DEV__ ? 'webpack --config webpack.config.dev.js --watch' : 'webpack --config webpack.config.js', { cwd: root, stdio: 'inherit' });

console.log('generated build successfully');
