增加任务
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user