import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'

export default defineConfig(({ command, mode }) => {
  const isBuild = command === 'build'

  return {
    base: isBuild ? '/admin/h5/' : './',
    plugins: [uni()],
    build: {
      minify: 'terser'
    },
    css: {
      preprocessorOptions: {
        scss: {
          silenceDeprecations: ['legacy-js-api', 'import']
        }
      }
    }
  }
})
