const path = require('path')

module.exports = {
  webpack: {
    configure: (webpackConfig, { env, paths }) => {
      // 添加 SVG 处理规则，用 @svgr/webpack 加载
      webpackConfig.module.rules.push({
        test: /\.svg$/,
        use: ['@svgr/webpack'],
        include: path.resolve(__dirname, 'src') // 限制范围，可选
      })
      return webpackConfig
    },
    alias: {
      // 配置 @ 指向 src 目录
      '@': path.resolve(__dirname, 'src')
    }
  }
}
