This commit is contained in:
Andrey Sharshov
2025-11-16 18:48:06 +01:00
commit c02d04073f
481 changed files with 52066 additions and 0 deletions

45
scripts/slotgamekit.js Executable file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/env node
const path = require('path');
const { execSync } = require('child_process');
// Получаем подкоманду и дополнительные аргументы
const [,, command, ...args] = process.argv;
// Функция для выполнения команды
function runCommand(cmd) {
try {
execSync(`${cmd} ${args.join(' ')}`, { stdio: 'inherit' });
} catch (error) {
console.error(`Error running command: ${cmd}`);
console.error(error.message);
process.exit(1);
}
}
// Определение пути к конфигурации
const configs = {
dev: path.resolve(__dirname, '../bundler/webpack.dev.js'),
prod: path.resolve(__dirname, '../bundler/webpack.prod.js'),
staging: path.resolve(__dirname, '../bundler/webpack.staging.js'),
};
// Обработка подкоманд
switch (command) {
case 'dev':
runCommand(`webpack --config ${configs.dev}`);
break;
case 'prod':
runCommand(`webpack --config ${configs.prod}`);
break;
case 'staging':
runCommand(`webpack --config ${configs.staging}`);
break;
case 'watch':
runCommand(`webpack serve --config ${configs.dev}`);
break;
default:
console.error(`Unknown command: ${command}`);
console.error('Available commands: dev, prod, staging, watch');
process.exit(1);
}