-
Notifications
You must be signed in to change notification settings - Fork 221
/
vite.config.ts
47 lines (46 loc) · 1.37 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import federation from '@originjs/vite-plugin-federation'
// https://vitejs.dev/config/
export default defineConfig({
server: {
// host: "192.168.56.1",
// port: 5100
},
cacheDir: 'node_modules/.cacheDir',
plugins: [
vue(),
federation({
name: 'layout',
filename: 'remoteEntry.js',
remotes: {
home: {
external: `Promise.resolve('http://localhost:5001/assets/remoteEntry.js')`,
externalType: "promise"
},
'common-lib': {
external:`new Promise(resolve=>resolve('http://localhost:5002/assets/remoteEntry.js'))`,
externalType:"promise"
},
'css-modules': 'http://localhost:5003/assets/remoteEntry.js'
},
shared: {
vue:{
// This is an invalid configuration, because the generate attribute is not supported on the host side
},
pinia:{
}
}
})
],
build: {
target: 'esnext',
minify: false,
cssCodeSplit: true,
rollupOptions: {
output: {
minifyInternalExports: false
}
}
}
})