-
Notifications
You must be signed in to change notification settings - Fork 0
/
emp-config.js
36 lines (36 loc) · 1.13 KB
/
emp-config.js
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
const vue2 = require('@efox/plugin-vue-2')
const {defineConfig} = require('@efox/emp')
const esm = (name, mode, version) =>
`https://esm.sh/${name}${version ? '@' + version : ''}${mode === 'development' ? '?dev' : ''}`
module.exports = defineConfig(({mode, env}) => {
// const target = 'es2018'
const target = 'es5'
const isESM = !['es3', 'es5'].includes(target)
return {
plugins: [vue2],
appEntry: 'main.js',
server: {port: 9001},
html: {title: 'EMP Vue2 Base'},
build: {target},
empShare: {
name: 'vue2Base',
exposes: {
'./Content': './src/components/Content',
'./Table': './src/components/table',
'./CompositionApi': './src/components/CompositionApi',
},
shareLib: !isESM
? {
vue: 'Vue@https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js',
'element-ui': [
'ELEMENT@https://unpkg.com/element-ui/lib/index.js',
`https://unpkg.com/element-ui/lib/theme-chalk/index.css`,
],
}
: {
vue: esm('vue'),
'element-ui': esm('element-ui'),
},
},
}
})