import { defineConfig } from 'umi'; const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); export default defineConfig({ title: 'SEECODER | 软件工程学习系统', favicon: '/logo.png', hash: true, ignoreMomentLocale: true, targets: { ios: false, }, nodeModulesTransform: { type: 'none', }, dynamicImportSyntax: {}, routes: [ { path:'/dev/:nameScope/:path/:ref', component:'@/pages/dev' }, { path: '/', component: '@/layout/index', routes: [ { path: '/', component: '@/pages/index', } ], } ], chainWebpack(memo, { env }) { memo.output.globalObject('this').set('globalObject', 'this'); memo.resolve.alias.set('vscode', '@codingame/monaco-languageclient/lib/vscode-compatibility') memo.plugin('monaco-editor').use(MonacoWebpackPlugin, [ { languages: [ 'javascript', 'typescript', 'css', 'html', 'json', 'markdown', 'java', 'python', 'cpp', 'xml', 'sql' ], }, ]); const isDev = env === 'development'; if (!isDev) { // ignore *.worker.js hash memo.output.set('filename', (pathData: any) => { return pathData.chunk.name.endsWith('.worker') ? '[name].js' : `[name].[contenthash:8].js`; }); } return memo; }, esbuild: {}, theme: { 'primary-color': '#3f87ff', 'border-radius-base': '0px', }, proxy: { '/api': { 'target':'http://localhost:8080', 'changeOrigin': true } }, tailwindcss: {}, });