增加任务
This commit is contained in:
@@ -11,18 +11,19 @@
|
||||
"type-check": "vue-tsc --build"
|
||||
},
|
||||
"dependencies": {
|
||||
"nacos-federation": "^1.0.2",
|
||||
"pinia": "^3.0.3",
|
||||
"vue": "^3.5.18",
|
||||
"vue": "^3.5.21",
|
||||
"vue-facing-decorator": "^4.0.1",
|
||||
"vue-router": "^4.0.6"
|
||||
"vue-router": "^4.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@originjs/vite-plugin-federation": "^1.4.1",
|
||||
"@types/node": "^24.5.2",
|
||||
"@vue3-oop/plugin-vue-jsx": "^1.5.1",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "~5.8.0",
|
||||
"vite": "^7.0.6",
|
||||
"vite-plugin-vue-devtools": "^8.0.0"
|
||||
"typescript": "~5.8.3",
|
||||
"vite": "^7.1.6",
|
||||
"vite-plugin-vue-devtools": "^8.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,44 +3,56 @@ import { fileURLToPath, URL } from 'node:url'
|
||||
import { defineConfig } from 'vite'
|
||||
import vueJsx from '@vue3-oop/plugin-vue-jsx'
|
||||
import federation from '@originjs/vite-plugin-federation';
|
||||
import { nacosServiceManage } from "nacos-federation";
|
||||
|
||||
export default defineConfig({
|
||||
server: {
|
||||
port: 1300,
|
||||
host: '0.0.0.0',
|
||||
strictPort: true,
|
||||
},
|
||||
plugins: [
|
||||
vueJsx(),
|
||||
federation({
|
||||
name: 'mainApp', // 主应用模块名(联邦模块需通过此名引用)
|
||||
remotes: { // 配置远程联邦模块地址(开发/生产需对应)
|
||||
product: 'http://localhost:1301/assets/remoteEntry.js',
|
||||
shared: 'http://localhost:1333/assets/remoteEntry.js'
|
||||
},
|
||||
shared: {
|
||||
vue: { requiredVersion: '^3.5.18' },
|
||||
'vue-router': { requiredVersion: '^4.0.6' },
|
||||
pinia: { requiredVersion: '^3.0.3' }
|
||||
}
|
||||
})
|
||||
],
|
||||
build: {
|
||||
target: 'esnext',
|
||||
minify: false,
|
||||
cssCodeSplit: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
minifyInternalExports: false
|
||||
}
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src/app/', import.meta.url)),
|
||||
'@shared': fileURLToPath(new URL('./src/shared/', import.meta.url)),
|
||||
'@features': fileURLToPath(new URL('./src/features/', import.meta.url)),
|
||||
'@domains': fileURLToPath(new URL('./src/domains/', import.meta.url))
|
||||
|
||||
export default defineConfig(async () => {
|
||||
const client = new nacosServiceManage({
|
||||
serverList: '192.168.31.100:8848',
|
||||
serviceName: 'main-app',
|
||||
port: 1300
|
||||
})
|
||||
const productUrl = await client.find("app-product")
|
||||
const sharedUrl = await client.find("app-shared")
|
||||
|
||||
return {
|
||||
server: {
|
||||
port: 1300,
|
||||
host: '0.0.0.0',
|
||||
strictPort: true,
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
vueJsx(),
|
||||
federation({
|
||||
name: 'mainApp', // 主应用模块名(联邦模块需通过此名引用)
|
||||
remotes: { // 配置远程联邦模块地址(开发/生产需对应)
|
||||
product: `${ productUrl }/assets/remoteEntry.js`,
|
||||
shared: `${ sharedUrl }/assets/remoteEntry.js`
|
||||
},
|
||||
shared: {
|
||||
vue: { requiredVersion: '^3.5.18' },
|
||||
'vue-router': { requiredVersion: '^4.0.6' },
|
||||
pinia: { requiredVersion: '^3.0.3' }
|
||||
}
|
||||
})
|
||||
],
|
||||
build: {
|
||||
target: 'esnext',
|
||||
minify: false,
|
||||
cssCodeSplit: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
minifyInternalExports: false
|
||||
}
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src/app/', import.meta.url)),
|
||||
'@shared': fileURLToPath(new URL('./src/shared/', import.meta.url)),
|
||||
'@features': fileURLToPath(new URL('./src/features/', import.meta.url)),
|
||||
'@domains': fileURLToPath(new URL('./src/domains/', import.meta.url))
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user