Skip to content

Commit

Permalink
feat(customize): update component registration #38
Browse files Browse the repository at this point in the history
Changes to be committed:
	modified:   index.js
	modified:   package-lock.json
	modified:   package.json
	renamed:    rollup.config.js -> rollup.config.mjs
  • Loading branch information
fajar-apri-alaska authored and blackfalcon committed Jul 10, 2023
1 parent 434eb39 commit cbacf51
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 21 deletions.
14 changes: 13 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
export * from './dist/auro-avatar';
import { AuroAvatar } from './src/auro-avatar.js';

/**
* Register Custom Element.
* @param {Object} name - Name to use for custom element.
* @returns {void}
*/
export function registerComponent(name) {
// alias definition
if (!customElements.get(name)) {
customElements.define(name, class extends AuroAvatar {});
}
}
59 changes: 42 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@commitlint/cli": "^17.4.4",
"@commitlint/config-conventional": "^17.4.4",
"@open-wc/testing": "^3.1.7",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-node-resolve": "^15.0.2",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^9.0.2",
Expand Down Expand Up @@ -68,7 +68,7 @@
"postcss-remove-rules": "^1.0.0",
"postcss-selector-replace": "^1.0.2",
"prismjs": "^1.29.0",
"rollup": "^2.79.1",
"rollup": "^3.23.0",
"rollup-plugin-serve": "^2.0.2",
"sass": "^1.58.3",
"semantic-release": "^20.1.0",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js → rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const production = !process.env.ROLLUP_WATCH;

const modernConfig = {
input: {
['auro-avatar__bundled']: './index.js',
'auro-avatar__bundled': './index.js',
},
output: {
format: 'esm',
Expand Down

0 comments on commit cbacf51

Please sign in to comment.