I've built a simple preact app using the default setup with preact cli's preact create
. Building my app using preact build
, the build
folder contains index.html
as an entry point/file, meaning my app is built as a stand-alone site.
What I would like to do though is embed my preact app on an existing webpage. This means that I (probably) need my built preact app to have a javascript file as an entry point that would contain something like:
import {render} from 'preact'
import App from './components/app'
render(<App />, document.getElementById('id-of-tag-on-an-existing-webpage'))
How do I achieve that?