https://blog.kalvad.com/export-your-angular-component-as-a-web-component/
ng g library <your-component-name>
./build.sh <your-component-name> [path/where/to/copy/your/lib]
- Include the file .js inside your application.
[optional] HotReload
- Copy
client.js
(insideautoupdate
folder) inside your project and include it in your html as a module. - Start server with
node autoupdate/server.js
Build on change
Watch for changes and re-build component with ./watch.sh <your-component-name> [path/where/to/copy/your/lib]
Enjoy :)
Usually working with node v14.18.3 and npm v6.14.15
error | possible solution |
---|---|
./watch.sh: line 16: run-when-changed: command not found | npm i -g run-when-changed |