import { defineConfig } from "umi";

export default defineConfig({
  base: '/',
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  outputPath: 'dataModel',
  esbuildMinifyIIFE: true,
  favicons: [
    '/favicon.ico'
  ],
  styles: [
    '//at.alicdn.com/t/c/font_4676747_4jkbw9dya3f.css',
    '//at.alicdn.com/t/c/font_4767192_5rinbe5e4f6.css',
  ],
  metas: [
    { name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' }
  ],
  proxy: {
    '/api': {
      // 'target': 'http://ab.dev.jbpm.shalu.com/',
      'target': 'https://edesign.shalu.com/',
      'changeOrigin': true,
      'pathRewrite': { '^/api' : '' },
    },
  },
  scripts: [
    '//at.alicdn.com/t/c/font_4767192_5rinbe5e4f6.js'
  ],
  plugins: [
    require.resolve('@umijs/plugins/dist/unocss'),
    require.resolve('@umijs/plugins/dist/model'),
    require.resolve('@umijs/plugins/dist/initial-state'),
    require.resolve('@umijs/plugins/dist/request'),
  ],
  request: {
    dataField: '',
  },
  model: {},
  unocss: {
    watch: ['src/**/*.tsx']
  },
  icons: {
    autoInstall: {}
  },
  history: { type: 'hash' },
  routes: [
    { path: "/", component: "home" },
    { path: "/er/:id", component: "er" },
    { path: "/detail/:id", component: "detail" },
    { path: "/*", component: '404' }
  ],
  npmClient: 'pnpm'
});
