@@ -16,12 +16,12 @@ const hyphenate = str => {
16
16
* @param {string } prefix The prefix for the component library
17
17
* @param {string } component The component name for single entry builds, component file for multi-entry builds
18
18
* @param {string } file The file for the component
19
- * @param {boolean } async Whether to load component async or not
19
+ * @param {boolean } isAsync Whether to load component async or not
20
20
*/
21
- const createElement = ( prefix , component , file , async ) => {
21
+ const createElement = ( prefix , component , file , isAsync ) => {
22
22
const { camelName, kebabName } = exports . fileToComponentName ( prefix , component )
23
23
24
- return async
24
+ return isAsync
25
25
? `window.customElements.define('${ kebabName } ', wrap(Vue, () => import('~root/${ file } ?shadow')))\n`
26
26
: `import ${ camelName } from '~root/${ file } ?shadow'\n` +
27
27
`window.customElements.define('${ kebabName } ', wrap(Vue, ${ camelName } ))\n`
@@ -38,12 +38,12 @@ exports.fileToComponentName = (prefix, file) => {
38
38
}
39
39
}
40
40
41
- exports . resolveEntry = ( prefix , libName , files , async ) => {
41
+ exports . resolveEntry = ( prefix , libName , files , isAsync ) => {
42
42
const filePath = path . resolve ( __dirname , 'entry-wc.js' )
43
43
const elements =
44
44
prefix === ''
45
45
? [ createElement ( '' , libName , files [ 0 ] ) ]
46
- : files . map ( file => createElement ( prefix , file , file , async ) ) . join ( '\n' )
46
+ : files . map ( file => createElement ( prefix , file , file , isAsync ) ) . join ( '\n' )
47
47
48
48
const content = `
49
49
import './setPublicPath'
0 commit comments