This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

修复打包配置

old
宇天 2021-11-24 11:32:04 +08:00
parent 8d2dc43b93
commit 867cbbdbe4
2 changed files with 8 additions and 8 deletions

View File

@ -107,6 +107,10 @@ function mkWCFile({ style, html, js }) {
.replace('watch() {', 'attributeChangedCallback(name, old, val) {\nif (old === val) {return}')
.replace('adopted()', 'adoptedCallback()')
js += `if(!customElements.get('wc-${parseName(name)}')){
customElements.define('wc-${parseName(name)}', ${name})
}`
return transform(js, ESBUILD_OPTIONS).then(res => {
return `/**
*
@ -117,10 +121,6 @@ function mkWCFile({ style, html, js }) {
*/
${res.code}
if(!customElements.get('wc-${parseName(name)}')){
customElements.define('wc-${parseName(name)}', ${name})
}
`
})
}

View File

@ -114,6 +114,10 @@ function mkWCFile({ style, html, js }) {
.replace('watch() {', 'attributeChangedCallback(name, old, val) {\nif (old === val) {return}')
.replace('adopted()', 'adoptedCallback()')
js += `if(!customElements.get('wc-${parseName(name)}')){
customElements.define('wc-${parseName(name)}', ${name})
}`
return transform(js, ESBUILD_OPTIONS).then(res => {
return `/**
*
@ -124,10 +128,6 @@ function mkWCFile({ style, html, js }) {
*/
${res.code}
if(!customElements.get('wc-${parseName(name)}')){
customElements.define('wc-${parseName(name)}', ${name})
}
`
})
}