Skip to content

Commit

Permalink
adjust comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alicewriteswrongs committed May 19, 2022
1 parent bb85ed8 commit 1541fee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/compiler/output-targets/dist-custom-elements/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,12 @@ export const addCustomElementInputs = (buildCtx: d.BuildCtx, bundleOpts: BundleO
exp.push(`export const ${exportName} = ${importAs};`);
exp.push(`export const defineCustomElement = cmpDefCustomEle;`);

// Here we push an import for this component onto our array which references the `coreKey` (prefixed with `\0`).
// We have to do this so that our import is referencing the correct virtual module, if we instead referenced, for
// instance, `cmp.sourceFilePath`, we would end up with duplicated modules in our output.
// Here we push an export (with a rename for `defineCustomElement` for
// this component onto our array which references the `coreKey` (prefixed
// with `\0`). We have to do this so that our import is referencing the
// correct virtual module, if we instead referenced, for instance,
// `cmp.sourceFilePath`, we would end up with duplicated modules in our
// output.
indexImports.push(
`export { ${exportName}, defineCustomElement as defineCustomElement${exportName} } from '${coreKey}';`
);
Expand Down

0 comments on commit 1541fee

Please sign in to comment.