-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemp-config.js
More file actions
34 lines (34 loc) · 857 Bytes
/
emp-config.js
File metadata and controls
34 lines (34 loc) · 857 Bytes
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
const {defineConfig} = require('@efox/emp')
const {cdn, esm} = require('./cdn')
module.exports = defineConfig(({mode, env}) => {
console.log('mode env', mode, env)
// const target = 'es2018'
const target = 'es5'
const isESM = !['es3', 'es5'].includes(target)
return {
build: {
target,
},
server: {
port: 8002,
},
empShare: {
name: 'microApp',
remotes: {
'@microHost': `microHost@http://127.0.0.1:8001/emp.js`,
},
exposes: {
'./App': './src/App',
},
shareLib: !isESM
? cdn(mode)
: {
react: esm('react', mode, '17.0.2'),
'react-dom': esm('react-dom', mode, '17.0.2'),
mobx: esm('mobx', mode),
'mobx-react-lite': esm('mobx-react-lite', mode),
},
},
html: {title: 'Micro-App'},
}
})