module.exports = {
  presets: [
    '@babel/preset-typescript',
    '@babel/preset-react',
    [
      '@babel/preset-env',
      {
        useBuiltIns: 'usage',
        corejs: '3.21.1',
        bugfixes: true
      }
    ]
  ],
  plugins: [
    ['@babel/plugin-proposal-decorators', { 'legacy': true }],
    '@babel/plugin-proposal-class-properties',
    [
      'module-resolver',
      {
        root: ['./src'],
        alias: {
          '@game': './src',
          '@root': './',
          '@core': '../core/src',
          '@map': '../map/src',
          '@server': '../game-server/src',
          '@api': '../game-api/src'
        }
      }
    ],
    '@loadable/babel-plugin'
  ],
  env: {
    development: {
      presets: [
        [
          '@babel/preset-env',
          {
            browserslistEnv: 'development'
          }
        ]
      ]
    }
  }
};
