Skip to content

Commit

Permalink
build: define custom elements in puik buddle
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgoud committed Sep 25, 2023
1 parent 912450f commit 536674f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/components/icon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import Icon from './src/icon.vue'
export const PuikIcon = withInstall(Icon)
export const PuikIconCe = defineCustomElement(PuikIcon)

customElements.define('puik-icon-ce', PuikIconCe)

export * from './src/icon'

export default { PuikIcon, PuikIconCe }
2 changes: 2 additions & 0 deletions packages/components/tooltip/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import Tooltip from './src/tooltip.vue'
export const PuikTooltip = withInstall(Tooltip)
export const PuikTooltipCe = defineCustomElement(PuikTooltip)

customElements.define('puik-tooltip-ce', PuikTooltipCe)

export * from './src/tooltip'

export default { PuikTooltip, PuikTooltipCe }
5 changes: 5 additions & 0 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import DefineOptions from 'unplugin-vue-define-options/vite'
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.includes('-ce'),
},
},
customElement: true,
}),
DefineOptions(),
Expand Down

0 comments on commit 536674f

Please sign in to comment.