I have successfully created an Angular Elements application following this awesome guide.
The "serve" process consists of:
- Build the application and concat into a single js file
ng build --prod --output-hashing=none && cat dist/tamigo-calendar/{runtime,polyfills,scripts,main}.js > ./plainHTML/ship.js
- Now serve a HTML file, containing the custom element. In this case
lite-server
.
But every time I do a change to the custom element, and wan't to see it updated I need to re-run the build script. So my question is this, how can I build this in watch mode?
The relevant parts of my package.json
looks like this:
"buildForShip": "ng build --prod --output-hashing=none && cat dist/tamigo-calendar/{runtime,polyfills,scripts,main}.js > ./plainHTML/ship.js",
"plainHTML": "lite-server"
"start": "npm run -s buildForShip && npm run -s plainHTML"