修复打包配置
parent
8d2dc43b93
commit
867cbbdbe4
|
@ -107,6 +107,10 @@ function mkWCFile({ style, html, js }) {
|
||||||
.replace('watch() {', 'attributeChangedCallback(name, old, val) {\nif (old === val) {return}')
|
.replace('watch() {', 'attributeChangedCallback(name, old, val) {\nif (old === val) {return}')
|
||||||
.replace('adopted()', 'adoptedCallback()')
|
.replace('adopted()', 'adoptedCallback()')
|
||||||
|
|
||||||
|
js += `if(!customElements.get('wc-${parseName(name)}')){
|
||||||
|
customElements.define('wc-${parseName(name)}', ${name})
|
||||||
|
}`
|
||||||
|
|
||||||
return transform(js, ESBUILD_OPTIONS).then(res => {
|
return transform(js, ESBUILD_OPTIONS).then(res => {
|
||||||
return `/**
|
return `/**
|
||||||
*
|
*
|
||||||
|
@ -117,10 +121,6 @@ function mkWCFile({ style, html, js }) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
${res.code}
|
${res.code}
|
||||||
|
|
||||||
if(!customElements.get('wc-${parseName(name)}')){
|
|
||||||
customElements.define('wc-${parseName(name)}', ${name})
|
|
||||||
}
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,10 @@ function mkWCFile({ style, html, js }) {
|
||||||
.replace('watch() {', 'attributeChangedCallback(name, old, val) {\nif (old === val) {return}')
|
.replace('watch() {', 'attributeChangedCallback(name, old, val) {\nif (old === val) {return}')
|
||||||
.replace('adopted()', 'adoptedCallback()')
|
.replace('adopted()', 'adoptedCallback()')
|
||||||
|
|
||||||
|
js += `if(!customElements.get('wc-${parseName(name)}')){
|
||||||
|
customElements.define('wc-${parseName(name)}', ${name})
|
||||||
|
}`
|
||||||
|
|
||||||
return transform(js, ESBUILD_OPTIONS).then(res => {
|
return transform(js, ESBUILD_OPTIONS).then(res => {
|
||||||
return `/**
|
return `/**
|
||||||
*
|
*
|
||||||
|
@ -124,10 +128,6 @@ function mkWCFile({ style, html, js }) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
${res.code}
|
${res.code}
|
||||||
|
|
||||||
if(!customElements.get('wc-${parseName(name)}')){
|
|
||||||
customElements.define('wc-${parseName(name)}', ${name})
|
|
||||||
}
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue