@vitejs/plugin-vue-jsx 不支持装饰器语法,所以换成@vitejs/plugin-vue-jsx插件,不需要任何配置就可以了
This commit is contained in:
@@ -3,9 +3,6 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
|
||||||
"node": "^20.19.0 || >=22.12.0"
|
|
||||||
},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"dep": "concurrently \"npm run build\" \"npm run preview\"",
|
"dep": "concurrently \"npm run build\" \"npm run preview\"",
|
||||||
@@ -20,15 +17,12 @@
|
|||||||
"vue-router": "^4.0.6"
|
"vue-router": "^4.0.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@abraham/reflection": "^0.13.0",
|
|
||||||
"@originjs/vite-plugin-federation": "^1.4.1",
|
"@originjs/vite-plugin-federation": "^1.4.1",
|
||||||
"@types/node": "^24.5.2",
|
"@types/node": "^24.5.2",
|
||||||
"@vue3-oop/plugin-vue-jsx": "^1.5.1",
|
"@vue3-oop/plugin-vue-jsx": "^1.5.1",
|
||||||
"injection-js": "^2.5.0",
|
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "~5.8.0",
|
"typescript": "~5.8.0",
|
||||||
"vite": "^7.0.6",
|
"vite": "^7.0.6",
|
||||||
"vite-plugin-vue-devtools": "^8.0.0",
|
"vite-plugin-vue-devtools": "^8.0.0"
|
||||||
"vue3-oop": "^1.2.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// import './assets/main.css'
|
// import './assets/main.css'
|
||||||
import '@abraham/reflection'
|
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export default class Home extends Vue {
|
|||||||
item: (val: ListItemType) => <li key={ val.id }>{ val.title }</li>
|
item: (val: ListItemType) => <li key={ val.id }>{ val.title }</li>
|
||||||
} }
|
} }
|
||||||
</Header>
|
</Header>
|
||||||
{ this.testHtml }
|
{ this.testHtml() }
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 vueJsx from '@vue3-oop/plugin-vue-jsx'
|
||||||
|
|
||||||
import federation from '@originjs/vite-plugin-federation';
|
import federation from '@originjs/vite-plugin-federation';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
server: {
|
server: {
|
||||||
port: 1300,
|
port: 1300,
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
vueJsx(),
|
vueJsx(),
|
||||||
federation({
|
federation({
|
||||||
name: 'mainApp', // 主应用模块名(联邦模块需通过此名引用)
|
name: 'mainApp', // 主应用模块名(联邦模块需通过此名引用)
|
||||||
remotes: { // 配置远程联邦模块地址(开发/生产需对应)
|
remotes: { // 配置远程联邦模块地址(开发/生产需对应)
|
||||||
product: 'http://localhost:1301/assets/remoteEntry.js',
|
product: 'http://localhost:1301/assets/remoteEntry.js',
|
||||||
shared: 'http://localhost:1333/assets/remoteEntry.js'
|
shared: 'http://localhost:1333/assets/remoteEntry.js'
|
||||||
},
|
},
|
||||||
shared: {
|
shared: {
|
||||||
vue: { requiredVersion: '^3.5.18' },
|
vue: { requiredVersion: '^3.5.18' },
|
||||||
'vue-router': { requiredVersion: '^4.0.6' },
|
'vue-router': { requiredVersion: '^4.0.6' },
|
||||||
pinia: { requiredVersion: '^3.0.3' }
|
pinia: { requiredVersion: '^3.0.3' }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
build: {
|
build: {
|
||||||
target: 'esnext',
|
target: 'esnext',
|
||||||
minify: false,
|
minify: false,
|
||||||
cssCodeSplit: true,
|
cssCodeSplit: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
minifyInternalExports: false
|
minifyInternalExports: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': fileURLToPath(new URL('./src/app/', import.meta.url)),
|
'@': fileURLToPath(new URL('./src/app/', import.meta.url)),
|
||||||
'@shared': fileURLToPath(new URL('./src/shared/', import.meta.url)),
|
'@shared': fileURLToPath(new URL('./src/shared/', import.meta.url)),
|
||||||
'@features': fileURLToPath(new URL('./src/features/', import.meta.url)),
|
'@features': fileURLToPath(new URL('./src/features/', import.meta.url)),
|
||||||
'@domains': fileURLToPath(new URL('./src/domains/', import.meta.url))
|
'@domains': fileURLToPath(new URL('./src/domains/', import.meta.url))
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user