import { defineConfig } from '@rsbuild/core'
import { pluginReact } from '@rsbuild/plugin-react'
import { pluginLess } from '@rsbuild/plugin-less'
import { pluginSvgr } from '@rsbuild/plugin-svgr'

const basename = '/sdream-fe'

export default defineConfig({
  plugins: [
    pluginReact(),
    pluginLess(),
    pluginSvgr(),
  ],
  dev: {
    assetPrefix: basename,
  },
  html: {
    title: '晓得. - 晓得解惑，让沟通更智能。',
    favicon: './src/assets/logo.png',
  },
  output: {
    target: 'web',
    assetPrefix: basename,
    distPath: {
      root: basename.slice(1),
      image: 'assets',
      svg: 'assets',
      font: 'assets',
      media: 'assets',
    },
  },
  source: {
    define: {
      'import.meta.env.MODE': JSON.stringify('dev'),
    },
  },
})
