insert
<script id="prices-widget" src="https://raw.githack.com/arashari/embeddable-widget/main/dist/widget.js" class-url="<class url>"></script>
in your HTML
https://hackernoon.com/building-embeddable-widgets-with-typescript
-
execute
yarn webpack
ornpm run webpack
for the build process.Remember to rebuild whenever you make code changes.
or automate it using
nodemon
or something like that. -
launch the local server with
npx http-serve dist
to serve the build. -
have fun
src/widget.template.ts
main file, template html-nya ada di sini
src/styles/main.scss
second main file, styling utamanya ada di sini
src/assets/*
untuk naro assets seperti gambar
- build it
- host the
dist
folder somewhere that publicly accessible - profit