增加任务

This commit is contained in:
编码猿
2025-09-20 02:26:42 +08:00
parent 32d40e1fa3
commit e038fdb965
14 changed files with 356 additions and 129 deletions

View File

@@ -13,11 +13,12 @@
"type-check": "vue-tsc --build"
},
"dependencies": {
"axios": "^1.12.2"
"axios": "^1.12.2",
"nacos-federation": "^1.0.2"
},
"devDependencies": {
"@originjs/vite-plugin-federation": "^1.4.1",
"typescript": "~5.8.0",
"vite": "^7.0.6"
"typescript": "~5.8.3",
"vite": "^7.1.6"
}
}

View File

@@ -1,35 +1,44 @@
import {defineConfig} from 'vite'
import federation from '@originjs/vite-plugin-federation';
import { defineConfig, UserConfig } from 'vite'
import federation from "@originjs/vite-plugin-federation";
import { nacosServiceManage } from "nacos-federation";
// https://vite.dev/config/
export default defineConfig({
server: {
port: 1333,
host: '0.0.0.0',
strictPort: true,
},
plugins: [
federation({
name: 'shared',
exposes: {
"./config": "./src/config/index.ts",
"./infra": "./src/infra/index.ts",
"./utils": "./src/utils/index.ts",
},
shared: {
axios: {requiredVersion: '^1.12.2'}
}
})
],
build: {
target: 'esnext',
minify: false,
cssCodeSplit: true,
rollupOptions: {
input: './src/index.ts',
output: {
format: 'esm',
minifyInternalExports: false
export default defineConfig(async (): Promise<UserConfig> => {
new nacosServiceManage({
serverList: '192.168.31.100:8848',
serviceName: 'app-shared',
port: 1333
})
return {
server: {
port: 1333,
host: '0.0.0.0',
strictPort: true,
cors: true
},
plugins: [
federation({
name: 'shared',
exposes: {
"./config": "./src/config/index.ts",
"./infra": "./src/infra/index.ts",
"./utils": "./src/utils/index.ts",
},
shared: {
axios: { requiredVersion: '^1.12.2' }
}
})
],
build: {
target: 'esnext',
minify: false,
cssCodeSplit: true,
rollupOptions: {
input: './src/index.ts',
output: {
format: 'esm',
minifyInternalExports: false
}
}
}
}