@vitejs/plugin-vue-jsx 不支持装饰器语法,所以换成@vitejs/plugin-vue-jsx插件,不需要任何配置就可以了
This commit is contained in:
@@ -1,47 +1,46 @@
|
||||
import {fileURLToPath, URL} from 'node:url'
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import {defineConfig} from 'vite'
|
||||
import { defineConfig } from 'vite'
|
||||
import vueJsx from '@vue3-oop/plugin-vue-jsx'
|
||||
|
||||
import federation from '@originjs/vite-plugin-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))
|
||||
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))
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user