1
0

.umirc.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { defineConfig } from 'umi';
  2. const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
  3. export default defineConfig({
  4. title: 'SEECODER | 软件工程学习系统',
  5. favicon: '/logo.png',
  6. hash: true,
  7. ignoreMomentLocale: true,
  8. targets: {
  9. ios: false,
  10. },
  11. nodeModulesTransform: {
  12. type: 'none',
  13. },
  14. dynamicImportSyntax: {},
  15. routes: [
  16. {
  17. path:'/dev/:nameScope/:path/:ref',
  18. component:'@/pages/dev'
  19. },
  20. {
  21. path: '/',
  22. component: '@/layout/index',
  23. routes: [
  24. {
  25. path: '/',
  26. component: '@/pages/index',
  27. }
  28. ],
  29. }
  30. ],
  31. chainWebpack(memo, { env }) {
  32. memo.output.globalObject('this').set('globalObject', 'this');
  33. memo.resolve.alias.set('vscode', '@codingame/monaco-languageclient/lib/vscode-compatibility')
  34. memo.plugin('monaco-editor').use(MonacoWebpackPlugin, [
  35. {
  36. languages: [
  37. 'javascript',
  38. 'typescript',
  39. 'css',
  40. 'html',
  41. 'json',
  42. 'markdown',
  43. 'java',
  44. 'python',
  45. 'cpp',
  46. 'xml',
  47. 'sql'
  48. ],
  49. },
  50. ]);
  51. const isDev = env === 'development';
  52. if (!isDev) {
  53. // ignore *.worker.js hash
  54. memo.output.set('filename', (pathData: any) => {
  55. return pathData.chunk.name.endsWith('.worker')
  56. ? '[name].js'
  57. : `[name].[contenthash:8].js`;
  58. });
  59. }
  60. return memo;
  61. },
  62. esbuild: {},
  63. theme: {
  64. 'primary-color': '#3f87ff',
  65. 'border-radius-base': '0px',
  66. },
  67. proxy: {
  68. '/api': {
  69. 'target':'http://localhost:8080',
  70. 'changeOrigin': true
  71. }
  72. },
  73. tailwindcss: {},
  74. });